function FrontPage_Form1_Validator(theForm) {
/*	if (theForm.ZipCode.value.length > 0 && theForm.ZipCode.value.length > 5)  {
		alert("Please enter at most 5 characters in the \"Zip/Postal code\" field.");
		theForm.ZipCode.focus();
		return (false);
	}

	var checkOK = "0123456789-";
	var checkStr = theForm.ZipCode.value;
	var allValid = true;
	var validGroups = true;
	var decPoints = 0;
	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;
		}
		allNum += ch;
	}
	if (!allValid) {
		alert("Please enter only digit characters in the \"Please enter a valid 5 digit zip code\" field.");
		theForm.ZipCode.focus();
		return (false);
	}
*/
	if (theForm.ctUpdate.checked && theForm.ctTraining.checked)
		theForm.Lists.value = "sub CDC-ClinicianTerrorismandEmergRespUpdates Clinician Registry,sub CDC-ClinicianTerrorismandEmergRespTraining Clinician Registry";
	else if (theForm.ctUpdate.checked)
		theForm.Lists.value = "sub CDC-ClinicianTerrorismandEmergRespUpdates Clinician Registry";
	else if (theForm.ctTraining.checked)
		theForm.Lists.value = "sub CDC-ClinicianTerrorismandEmergRespTraining Clinician Registry";
	else {
		if (theForm.name == "FrontPage_Form1") {				// OK to have both blank on updateForm
			alert("Please select one of the \"Lists\" options.");
			theForm.ctUpdate.focus();
			return (false);
		}
	}
	if (checkemail(theForm.Contact_Email.value)==0) {
		theForm.Contact_Email.focus();
		return (false);
	}
	return (true);
}

function checkemail (emailStr) {
	var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	var validChars="\[^\\s" + specialChars + "\]"
	var quotedUser="(\"[^\"]*\")"
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+'
	var word="(" + atom + "|" + quotedUser + ")"
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")

	var matchArray=emailStr.match(emailPat)

	if (matchArray==null) {
		alert("Email address seems incorrect (check @ and .'s)");
		return 0;
	}
	var user=matchArray[1];
	var domain=matchArray[2];

	if (user.match(userPat)==null) {
		alert("The username doesn't seem to be valid.");
		return 0;
	}

	var IPArray=domain.match(ipDomainPat)
	if (IPArray!=null) {
		// this is an IP address
		  for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				alert("Destination IP address is invalid!");
			return 0;
			}
		}
		return 1;
	}

	var domainArray=domain.match(domainPat)
	if (domainArray==null) {
		alert("The domain name doesn't seem to be valid.");
		return 0;
	}

	var atomPat=new RegExp(atom,"g");
	var domArr=domain.match(atomPat);
	var len=domArr.length;
	if (domArr[domArr.length-1].length<2 || 
		domArr[domArr.length-1].length>4) {
	   // the address must end in a two letter or three letter word.
	   alert("The address must end in a three or four -letter domain, or two letter country.");
	   return 0;
	}

	// Make sure there's a host name preceding the domain.
	if (len<2) {
	   var errStr="This address is missing a hostname!";
	   alert(errStr);
	   return 0;
	}

	// If we've gotten this far, everything's valid!
	return 1;
}

function validEmail() {
	if (checkemail(document.getUserEMail.eMail.value)==1)
		return true;
	else
		return false;
}