<!-- Begin

function FormFocus()
{
	frmInfo.txtCompanyName.focus();
}


//--------------------End Phone and Email Validation Functions----------------//

// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   
    var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   
    var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone)
{
    s=stripCharsInBag(strPhone,validWorldPhoneChars);
    return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

//--------------------End Phone and Email Validation Functions----------------//


function Form_Validator(theForm)
{

	if (theForm.name.value == "")
	{
		alert("Please enter a your full name.");
		theForm.name.focus();
		return (false);
	}
/*
	if (theForm.contact.value == "")
	{
		alert("Please enter your first and last name.");
		theForm.contact.focus();
		return (false);
	}

	if (theForm.address.value == "")
	{
		alert("Please enter an address");
		theForm.address.focus();
		return (false);
	}

	if (theForm.city.value == "")
	{
		alert("Please enter a city");
		theForm.city.focus();
		return (false);
	}

	/*if (theForm.slcState.selectedIndex == 0)
	{
		alert("Please select a state");
		theForm.slcState.focus();
		return (false);
	}
	if (theForm.state.value == "")
	{
		alert("Please enter a state");
		theForm.state.focus();
		return (false);
	}



//----------------Zip Code Validation--------------//

    var valid = "0123456789";

    if (theForm.zip.value.length!=5) 
    {
        alert("Please enter a 5 digit zip code.");
		theForm.zip.focus()
        return false;
    }
    for (var i=0; i < theForm.zip.value.length; i++) 
    {
        temp = "" + theForm.zip.value.substring(i, i+1);
        if (valid.indexOf(temp) == "-1") 
        {
            alert("Invalid characters in zip code. Please try again.");
		    theForm.zip.focus()
            return false;
        }

    }

//----------------Phone Number Validation--------------//

    //--Phone1
	if ((theForm.phone.value==null)||(theForm.phone.value==""))
    {
		alert("Please Enter a Phone Number")
		theForm.phone.focus()
		return false
	}
	if (checkInternationalPhone(theForm.phone.value)==false)
    {
		alert("Please Enter a Valid Phone Number")
		theForm.phone.value=""
		theForm.phone.focus()
		return false
	}

*/


//----------------Email Address Validation--------------//

    if (theForm.email.value == "")
    {
      alert("Please enter an email address");
      theForm.email.focus();
      return (false);
    }

    if (!isEmailAddr(theForm.email.value))
    {
      alert("Please enter a complete email address: yourname@yourdomain.com");
      theForm.email.focus();
      return (false);
    }

	if (theForm.comments.value == "")
	{
		alert("Please comment on how we may help you.");
		theForm.comments.focus();
		return (false);
	}


/*
	if (theForm.slcDirectmail.selectedIndex == 0)
	{
		alert("Do you have a direct mail piece?");
		theForm.slcDirectmail.focus();
		return (false);
	}

//----------------Contacts Validation--------------//

	if (theForm.slcDirectmail.selectedIndex == 1)
	{
        var valid = "0123456789";

	    if (theForm.txtContacts.value == "")
	    {
	    	alert("Please enter the number of contacts.");
	    	theForm.txtContacts.focus();
	    	return (false);
	    }


        for (var i=0; i < theForm.txtContacts.value.length; i++) 
        {
            temp = "" + theForm.txtContacts.value.substring(i, i+1);
            if (valid.indexOf(temp) == "-1") 
            {
                alert("Please enter numbers only.");
	    	    theForm.txtContacts.focus()
                return false;
            }
        }
	}


	if (theForm.slcList.selectedIndex == 0)
	{
		alert("Do you need to purchase a list?");
		theForm.slcList.focus();
		return (false);
	}     

	if (theForm.txtStartDate.value == "")
	{
		alert("Please enter a start date.");
		theForm.txtStartDate.focus();
		return (false);
	}

	if (theForm.txtBudget.value == "")
	{
		alert("Please enter a budget.");
		theForm.txtBudget.focus();
		return (false);
	}

	if (theForm.txtLength.value == "")
	{
		alert("Please enter a start Length.");
		theForm.txtLength.focus();
		return (false);
	}

	if (theForm.slcHear.selectedIndex == 0)
	{
		alert("Please tell us how you heard about us?");
		theForm.slcHear.focus();
		return (false);
	}

	if (theForm.slcHear.selectedIndex == 4)
	{
		if (theForm.txtOther.value == "")
		{
			alert("Please tell us the other method that you heard about us.");
			theForm.txtOther.focus();
			return (false);
		}
	}*/

	return (true);
}


//  End -->
