var myRegExp = /^[0-9]{5}$/;
var acceptError;
 <!--

function ValidatePage() {
			
	var sTrimLogin;
	var sTrimPassword;
	var sTrimEMail;
	var invalidCharacterList = '\/\'\\ ";:?,!#()[]\{\}^|'; // Add any additional invalid email characters here
	
	sTrimLogin = document.frmJoin.Login.value.replace(/\ /g,"");
	sTrimPassword = document.frmJoin.Password.value.replace(/\ /g,"");
	sTrimEMail = document.frmJoin.EMail.value.replace(/\ /g,"");
	
	if (document.frmJoin.PromoCode){
		if (document.frmJoin.PromoCode.value == "Join30Free"){
			document.frmJoin.PromoCode.value = "";
		}
	}
	if (document.frmJoin.bAlreadySubmitted.value == 1) {
		return false;
	}
	  
		
	if (!document.frmJoin.FirstName.value){
		FieldError("FirstName");
		alert("Please fill in the highlighted field.");
		document.frmJoin.FirstName.focus();
		return false;
	}else{
	FieldColor("FirstName");
	}            
	
	if(!document.frmJoin.LastName.value) {
		 FieldError("LastName");
		alert("Please fill in the highlighted field.");
		document.frmJoin.LastName.focus();
		return false;}
	else{
	FieldColor("LastName");
	}                 
		
	// Check email address to make sure it atleast looks like a valid one
	var sEMail = document.frmJoin.EMail.value;

	var bValidEmail = true;
	
	var nIndexOfAt;
	var nIndexOfDot;
	var nLastIndexOfDot;
	var nFound;

	if (sTrimEMail.length > 0) {
		nIndexOfAt = sEMail.indexOf("@");
		nIndexOfDot = sEMail.indexOf(".");
		
		nLastIndexOfDot = 0
		nFound = 0
		
		while (nFound != -1) {
			nLastIndexOfDot = nFound;
			nFound = sEMail.indexOf(".",nFound + 1);
		}
		
		if (sEMail.length < 6 || nIndexOfAt < 1 || nIndexOfDot < 1 || nLastIndexOfDot > sEMail.length - 3)
			bValidEmail = false;
		
		if (sEMail.indexOf("@",nIndexOfAt + 1) != -1)
			bValidEmail = false;
		
		if (nLastIndexOfDot <= nIndexOfAt + 1)
			bValidEmail = false;
		
		for(i=0;i<invalidCharacterList.length;i++) {
	
		var invalidCharacter=invalidCharacterList.charAt(i)
			if(sEMail.indexOf(invalidCharacter,0)>-1) {
				bValidEmail = false;
			}
		}
		
		if (!bValidEmail) {
			FieldError("EMail");
			alert("Please enter a valid email address.");
			document.frmJoin.EMail.focus();
			document.frmJoin.EMail.select();
			return false;
		}
		else{
			FieldColor("EMail");
		}            
	} else {
		FieldError("EMail");
		alert("Please fill in the highlighted field.");
		document.frmJoin.EMail.value = "";
		document.frmJoin.EMail.focus();
		document.frmJoin.EMail.select();
		return false;
	}
	if (!document.frmJoin.EMail2.value){
		 FieldError("EMail");
		 FieldError("EMail2");
		alert("Please check in the highlighted field.");
		document.frmJoin.EMail2.focus();
		return false;
		}
	 else{
		FieldColor("EMail");
		FieldColor("EMail2");
	 }
	if (document.frmJoin.EMail2.value.toLowerCase() != document.frmJoin.EMail.value.toLowerCase()){
		 FieldError("EMail");
		 FieldError("EMail2");
		// document.frmJoin.EMail.value = "";
		document.frmJoin.EMail2.value = ""
		alert("Confirm Email must match Email Address.  Please re-enter.");
		document.frmJoin.EMail2.focus();
		return false;
		}
	 else{
		FieldColor("EMail");
		FieldColor("EMail2");
	 }









	if (!document.frmJoin.Address.value || !document.frmJoin.City.value || !document.frmJoin.State.value || !document.frmJoin.Zip.value) {
		FieldError("Address");
		FieldError("City");
		FieldError("State");
		FieldError("Zip");
		alert("Please fill in the highlighted fields.");
		document.frmJoin.Address.focus();
		return false;
	} else{
		FieldColor("Address");
		FieldColor("City");
		FieldColor("State");
		FieldColor("Zip");
	}            

	if(!myRegExp.test(document.frmJoin.Zip.value)) {
		FieldError("Zip");
		alert("Please enter a valid zip code.");
		document.frmJoin.Zip.focus();
	return false;
	} else {
		FieldColor("Zip");
	}            

	if (!document.frmJoin.Gender.value || document.frmJoin.Gender.value == "Select Gender...") {
		FieldError("Gender");
		alert("Please fill in the highlighted field.");
		document.frmJoin.Gender.focus();
		return false;
	} else {
		FieldColor("Gender");
	}
	
	
	if (!document.frmJoin.Age.value || document.frmJoin.Age.value == "Select Year...") {
		FieldError("Age");
		alert("Please fill in the highlighted field.");
		document.frmJoin.Age.focus();
		return false;
	} else {
		FieldColor("Age");
	}

	if (sTrimLogin.length == 0) {
		FieldError("Login");
		alert("Please fill in the highlighted field.");
		document.frmJoin.Login.value = "";
		document.frmJoin.Login.focus();
		return false;
	} else {
		var valid="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
		for (var i = 0; i<sTrimLogin.length; i++){
			if (valid.indexOf(sTrimLogin.substring(i, i+1)) == -1){
				FieldError("Login");
				alert("Login name may only contain numbers and letters.");
				document.frmJoin.Login.value = "";
				document.frmJoin.Login.focus();
				return false;
			}
		}
		FieldColor("Login");
	}
	
	
	if (sTrimPassword.length == 0) {
		FieldError("Password");
		alert("Please fill in the highlighted field.");
		document.frmJoin.Password.value = "";
		document.frmJoin.Password.focus();
		return false;
	} else {
		FieldColor("Password");
	}
	
	if (document.frmJoin.Password.value != document.frmJoin.ConfirmPassword.value) {
		FieldError("Password");
		FieldError("ConfirmPassword");
		alert("Confirm Password must match Create Pasword.  Please re-enter.");
		document.frmJoin.Password.value = "";
		document.frmJoin.ConfirmPassword.value = "";
	
		document.frmJoin.Password.focus();
		document.frmJoin.Password.select();
		return false;
	} else {
		FieldColor("Password");
		FieldColor("ConfirmPassword");
	}

	if (document.frmJoin.Password.value.length < 4) {
		FieldError("Password");
		FieldError("ConfirmPassword");
		alert("Please choose a password at least 4 characters long.");
		document.frmJoin.Password.value = "";
		document.frmJoin.ConfirmPassword.value = "";
	
		document.frmJoin.Password.focus();
		document.frmJoin.Password.select();
		return false;
	} else {
		FieldColor("Password");
		FieldColor("ConfirmPassword");
	}
	
	if (document.frmJoin.Password.value == document.frmJoin.Login.value) {
		FieldError("Password");
		FieldError("ConfirmPassword");
		alert("Please choose a password that is different from your username.");
		document.frmJoin.Password.value = "";
		document.frmJoin.ConfirmPassword.value = "";
		document.frmJoin.Password.focus();
		return false;
	} else {
		FieldColor("Password");
		FieldColor("ConfirmPassword");
	}
		
	if (!document.frmJoin.AcceptTerms.checked) {
		alert(acceptError);
		document.frmJoin.AcceptTerms.focus();
		return false;
	}
	
	document.frmJoin.bAlreadySubmitted.value = 1;
	return true;
}