// Validate input from regform

function Form_Validator(theForm)
{
	/*  only needed if e-mail validation required
	var emailOK;
	*/
	
	if (theForm.firstName.value == ""){
		alert("Please enter your first name.");
		theForm.firstName.focus();
		return false;
	}		
	if (theForm.lastName.value == ""){
		alert("Please enter your last name.");
		theForm.lastName.focus();
		return false;
	}

	// check if email1 is filled in, and verify it is the same as email2
	if (theForm.email1.value == ""){
		alert("Please enter your e-mail address.");
		theForm.email1.focus();
        	return false;
  	}
	if (theForm.email1.value != theForm.email2.value) {
		alert("The e-mail addresses you entered do not match. Please re-enter your e-mail address.");
		theForm.email1.focus();
        	return false;
	}

/*  calls validation function for email -- not currently needed
	emailOK = validemail(theForm.Email.value, theForm);
	if (!emailOK)
	{
		return (false);
	}
*/
return (true);
}

/*
function validemail(emailaddress, theForm)
{
// this function checks the email address against the array of domains
//   1. change "strErrorMsg" to suit your needs
//   2. add domains to the aDomains array

var strErrorMsg = "Please provide your corporate email address."; 
var emailDomain; var nStart;

// create array of email domains to check
var aDomains = new Array(2); // change this to match the length of your list
// add your list below
aDomains[0] = "yahoo.com";
aDomains[1] = "hotmail.com";

// loop thru domains, if a match is found, display error and return
for(i=0; i<aDomains.length; i++){
	nStart = emailaddress.indexOf("@");
	if(nStart == -1){
		alert(strErrorMsg);
		theForm.Email.focus();
		return (false);
	}		
	nStart++;
	emailDomain = emailaddress.substr(nStart);
	if(emailDomain == aDomains[i]){
		alert(strErrorMsg);
		theForm.Email.focus();
		return (false);
	}
}
return (true);
}
*/




