<!-- Begin
function Field_Validator(theForm)
{
	if (theForm.name.value == "")
	{
		alert("Please enter your name.");
		theForm.name.focus();
		return (false);
	}


	if (theForm.email.value == "")
	{
		alert("Please enter your email address.");
		theForm.email.focus();
		return (false);
	}


	if (!(VerifyEmailAddress(theForm.email)))
	    return (false);

	return (true);

}



function VerifyEmailAddress(EmailForm)
{
  var Reason  = "Email Address entered incorrectly. \n\nReason:"
  var checkStr = EmailForm.value;
  var ix = (checkStr.length - 4)
  var RC = true;
  var at_position = MissingDomainName = MissingUserName = 0
  var x = CharsInValid = AtSignValid = DoublePeriod = PeriodValid = SpaceValid = ExtValid = RL = 0;
	for (i = 0;  i < checkStr.length;  i++)
	{
		if (checkStr.charAt(i) == '@')
		{
			at_position = i;
			AtSignValid++;
			if (at_position == 0)
				MissingUserName++;
		}
		else if (checkStr.charAt(i) == '.')
		{
			if (x == (i-1))
				DoublePeriod++;
			else
			{
				x = i;
				PeriodValid++;
				if (at_position == (i-1))
					MissingDomainName++;
			}
		}
		else
		{
			if (!( (checkStr.charAt(i) >= "A" && checkStr.charAt(i) <= "Z") 
				|| (checkStr.charAt(i) >= "a" && checkStr.charAt(i) <= "z") 
				|| (checkStr.charAt(i) == "@") 
				|| (checkStr.charAt(i) == ".") 
				|| (checkStr.charAt(i) == "_") 
				|| (checkStr.charAt(i) == "-") 
				|| (checkStr.charAt(i) >= "0" && checkStr.charAt(i) <= "9")
				)){
				if (checkStr.charAt(i) == ' ')
					SpaceValid ++;
				else
					CharsInValid++;
				}
		}
	}
	if (checkStr.indexOf(".com", ix) > -1)
		ExtValid++;
	else if (checkStr.indexOf(".edu", ix) > -1)
		ExtValid++;
	else if (checkStr.indexOf(".net", ix) > -1)
		ExtValid++;
	else if (checkStr.indexOf(".org", ix) > -1)
		ExtValid++;
	else if (checkStr.indexOf(".gov", ix) > -1)
		ExtValid++;
	RL = Reason.length;
	if (AtSignValid != 1)
		Reason += "\nOnly one '@' allowed, " + AtSignValid + " found.";
	if (MissingUserName > 0)
		Reason += "\nThe user name is missing.";
	if (MissingDomainName > 0)
		Reason += "\nThe domain name is missing.";
	if (PeriodValid == 0)
		Reason += "\nAddress must contain at least one period.";
	if (SpaceValid > 0)
		Reason += "\nNo Spaces allowed. Address contains " + SpaceValid + " space";
	if (SpaceValid > 1)
		Reason += "s.";
	if (CharsInValid > 0)
		Reason += "\nAddress contains " + CharsInValid + " invalid character";
	if (CharsInValid > 1)
		Reason += "s.";
	if (DoublePeriod > 0)
		Reason += "\nAddress contains multiple periods in a row.";
	if (ExtValid == 0)
		Reason += "\nInvalid Domain Suffix entered.\n(Valid: .com, .edu, .net, .org, .gov)";
	if (checkStr.length > 120)
		Reason += "\nPlease limit the Email Address to 120 characters.";

	if (RL != Reason.length)
	{
		alert(Reason);
		EmailForm.focus();
		RC = false;
		}
	else
		RC = true;
	return(RC);
}

// End -->
