function Form1_Validator(theForm)
{

var alertsay = ""; 

// check to see if the field is blank
if (theForm.txtFName.value == "")
{
alert("You must enter your first name.");
theForm.txtFName.focus();
return (false);
}

// require at least 3 characters be entered
if (theForm.txtFName.value.length < 3)
{
alert("Please enter at least 3 characters in the \"First Name\" field.");
theForm.txtFName.focus();
return (false);
}

// allow ONLY alphanumeric keys, no symbols or punctuation
// this can be altered for any "checkOK" string you desire
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
var checkStr = theForm.txtFName.value;
var allValid = true;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
}
if (!allValid)
{
alert("Please enter only letter and numeric characters in the \"First Name\" field.");
theForm.txtFName.focus();
return (false);
}

// CHECK LAST NAME
// check to see if the field is blank
if (theForm.txtLName.value == "")
{
alert("You must enter your last name.");
theForm.txtLName.focus();
return (false);
}

// require at least 3 characters be entered
if (theForm.txtLName.value.length < 3)
{
alert("Please enter at least 3 characters in the \"Last Name\" field.");
theForm.txtLName.focus();
return (false);
}

// allow ONLY alphanumeric keys, no symbols or punctuation
// this can be altered for any "checkOK" string you desire
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
var checkStr = theForm.txtLName.value;
var allValid = true;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
}
if (!allValid)
{
alert("Please enter only letter and numeric characters in the \"Last Name\" field.");
theForm.txtLName.focus();
return (false);
}

// check if email field is blank
if (theForm.txtEmail.value == "")
{
alert("Please enter a value for the \"Email\" field.");
theForm.txtEmail.focus();
return (false);
}


// test if valid email address, must have @ and .
var checkEmail = "@.";
var checkStr = theForm.txtEmail.value;
var EmailValid = false;
var EmailAt = false;
var EmailPeriod = false;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkEmail.length;  j++)
{
if (ch == checkEmail.charAt(j) && ch == "@")
EmailAt = true;
if (ch == checkEmail.charAt(j) && ch == ".")
EmailPeriod = true;
	  if (EmailAt && EmailPeriod)
		break;
	  if (j == checkEmail.length)
		break;
	}
	// if both the @ and . were in the string
if (EmailAt && EmailPeriod)
{
		EmailValid = true
		break;
	}
}
if (!EmailValid)
{
alert("The \"email\" field must contain an \"@\" and a \".\".");
theForm.txtEmail.focus();
return (false);
}

// check if numbers field is blank
if (theForm.txtPhone.value == "")
{
alert("Please enter your 10 digit value for the \"Phone\" field.");
theForm.txtPhone.focus();
return (false);
}

// only allow numbers to be entered
var checkOK = "0123456789()-";
var checkStr = theForm.txtPhone.value;
var allValid = true;
var allNum = "";
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter your 10 digit value for the \"Phone\" field.");
theForm.txtPhone.focus();
return (false);
}

// check if it's 10 digit value
if (theForm.txtPhone.value.length < 10)
{
alert("Please enter your 10 digit value for the \"Phone\" field.");
theForm.txtPhone.focus();
return (false);
}

// check the address
if (theForm.txtAddress.value == "")
{
alert("Please enter your street number and street name for the \"Address\" field.");
theForm.txtAddress.focus();
return (false);
}

// check the city
if (theForm.txtCity.value == "")
{
alert("Please enter your City for the \"City\" field.");
theForm.txtCity.focus();
return (false);
}

// check the state
if (theForm.txtProvince.value == "")
{
alert("Please enter your State for the \"State\" field.");
theForm.txtProvince.focus();
return (false);
}

// check the country
if (theForm.txtCountry.value == "")
{
alert("Please enter your Country for the \"Country\" field.");
theForm.txtCountry.focus();
return (false);
}

// check the postal
if (theForm.txtPostal.value == "")
{
alert("Please enter your Zip Code for the \"Zip Code\" field.");
theForm.txtPostal.focus();
return (false);
}


// check the info requested
if (theForm.txtInfo.value == "")
{
alert("Please enter the information you are requesting.");
theForm.txtInfo.focus();
return (false);
}


// check the message
if (theForm.txtText.value == "")
{
alert("Please enter your message or inquiry.");
theForm.txtText.focus();
return (false);
}

return (true);

}
