
<!--
function Form1_Validator(theForm)
{
	
// check to see if the field is blank
if (theForm.txtFirstName.value == "")
{
alert("You must enter your FirstName.");
theForm.txtFirstName.focus();
return (false);
}

// require at least 2 characters be entered
if (theForm.txtFirstName.value.length < 2)
{
alert("Please enter at least 2 characters in the \"FirstName\" field.");
theForm.txtFirstName.focus();
return (false);
}


// check to see if the field is blank
if (theForm.txtSurName.value == "")
{
alert("You must enter your SurName.");
theForm.txtSurName.focus();
return (false);
}


// check to see if the field is blank
if (theForm.txtAddress.value == "")
{
alert("You must enter your Address.");
theForm.txtAddress.focus();
return (false);
}


// check to see if the field is blank
if (theForm.txtCity.value == "")
{
alert("You must enter your City.");
theForm.txtCity.focus();
return (false);
}

// check to see if the field is blank
if (theForm.txtStateCounty.value == "")
{
alert("You must enter your State/County.");
theForm.txtStateCounty.focus();
return (false);
}

// check to see if the field is blank
if (theForm.txtCountry.value == "")
{
alert("You must select your Country.");
theForm.txtCountry.focus();
return (false);
}


// check to see if the field is blank
if (theForm.txtZipPostcode.value == "")
{
alert("You must enter your Zip/Postcode.");
theForm.txtZipPostcode.focus();
return (false);
}


// check if email field is blank
var form_email = theForm.txtEmail.value;
var invalidChars = " /:;,"
var badChar =""
if (form_email== "")
{
alert("You must enter your Email.");
 return (false);
}
for (i = 0;  i < invalidChars.length;  i++)
{
badChar=invalidChars.charAt(i);
if(form_email.indexOf(badChar,0)>-1)
{
alert("You cannot have a /:;, or a space");
theForm.txtEmail.focus();
return (false);
}
}
atPos=form_email.indexOf("@",1)
if(atPos==-1)
{
alert("Your Email is not Valid, must have an @");
theForm.txtEmail.focus();
return (false);
}
if(form_email.indexOf("@",atPos+1)>-1)
{
alert("You cannot have two @'s");
theForm.txtEmail.focus();
return (false);
}
periodPos=form_email.indexOf(".",atPos)
if(periodPos==-1)
{
alert("There must be an . in your email address");
theForm.txtEmail.focus();
return (false);
}
if(periodPos+3>form_email.length)
{
alert("There must be atleast two letters after .");
theForm.txtEmail.focus();
return (false);
}

// check to see if the field is blank
if (theForm.txtUserName.value == "")
{
alert("You must enter a UserName.");
theForm.txtUserName.focus();
return (false);
}

return (true);
}
//-->

   