<!-- hide from archaic browsers...
/***********************************************************************************
* validate() is the code's primary function, responsible for directing traffic and *
* calling all of the other functions that validate the required fields of the form. *
************************************************************************************/
function validate(inForm)
{
// a person's name should contain only alpha characters, spaces, hyphens, apostrophes...
	if (inForm.name.value == ""){
		alert("Please enter your full name.")
		inForm.name.focus()
		return false
	}
	if (!alphaValid(inForm.name.value)){
		alert("Your full name is entered incorrectly.\nPlease re-enter your name.")
		inForm.name.focus()
		inForm.name.select()
		return false
	}// end first name check
	
	// email should not contain a blank, slash, colon, semi-colon or comma.
	if (inForm.email.value == ""){
		alert("Please enter your email address.")
		inForm.email.focus()
		return false
	}
	if (!emailValid(inForm.email.value)){
		alert("Your email address appears to have been entered incorrectly.\nPlease re-enter your email address, including exactly one '@' symbol.")
		inForm.email.focus()
		inForm.email.select()
		return false
	}//end email check; end all checks
	return true
}//end function validate()

/*******************************************************
*	define all functions that check required form fields *
*******************************************************/

function alphaValid(inAlpha){
	for (i=0; i<inAlpha.length; i++){
		j=inAlpha.charAt(i)
		if (!(((j >= "A") && (j <= "Z")) || ((j >= "a") && (j <= "z")) || (j == "-") || (j ==" ") || 
			(j == "'"))){
			return false
		}
	}
	return true
}

function emailValid(inEmail){
	invalidChars = " /:,;"
	for (i=0; i<invalidChars.length; i++){
		badChar = invalidChars.charAt(i)
		if (inEmail.indexOf(badChar,0) > -1){
			return false
		}
	}
	atPos = inEmail.indexOf("@",1)
	if (atPos == -1){
		return false
	}
	if (inEmail.indexOf("@",atPos+1) != -1){
		return false
	}
	periodPos = inEmail.indexOf(".",atPos)
	if (periodPos == -1){
		return false
	}
	if (periodPos+3 > inEmail.length){
		return false
	}
	return true
}
// end hide -->