<!--
	
var charexp = /./
var letterexp = /[a-z]/i
var phonexp =  /^\d{10}$/
var memberexp = /^\d{3}$/
var zipexp = /^\d{5}$|^\d{5}[\-\s]?\d{4}$/
var emailexp = /^[a-z][a-z_0-9\.]+@[a-z_0-9-\.]+\.[a-z]$/i
var pledgexp = /^\d*$|^\d*\.\d{2}$/

function isValid(pattern, str) {
	return pattern.test(str)
}

function hasLetter(str) {
	return letterexp.test(str)
}

function hasChar(str) {
	return charexp.test(str)
}

function stripChars(pattern, str) {
	return str.replace(pattern,"")
}

function stripNonDigits(str) {
	return str.replace(/[^0-9]/g,"")
}

function isEmail(elm) {
	if(elm.value.indexOf("@") != "-1" &&
		elm.value.indexOf(".") != "-1" &&
		elm.value.indexOf("!") == "-1" &&
		elm.value.indexOf("+") == "-1" &&
		elm.value.indexOf("\"") == "-1" &&
		elm.value.indexOf("'") == "-1" &&
		elm.value.indexOf("_") != "0" &&
		elm.value.indexOf("-") != "0" &&
		elm.value != "")
	return true;
	else return false;
	}


function checkform(form) {

	//Check the first name text box for an entry
	if  (!hasLetter(form.firstname.value)) {
		alert("Invalid first name")
		form.firstname.focus()
		return false
	}

	//Check the last name text box for an entry
	if (!hasLetter(form.lastname.value)) {
		alert("Invalid last name")
		form.lastname.focus()
		return false
	}

	//Check that the member number entry is valid
//	if (!isValid(memberexp,form.membernum.value)) {
//		alert("Invalid member number")
//		form.membernum.focus()
//		return false
//	}

	//Check that the ZIP code entry is valid.
//	if (!isValid(zipexp,form.zip.value)) {
//		alert("Invalid ZIP code")
//		form.zip.focus()
//		return false
//	}

	if(isEmail(form.email)==false) {
		alert("Please enter a valid email address");
		form.email.focus();
		return false
		}

	//Check that the email entry is valid
//	if (!isValid(emailexp,form.email.value)) {
//		alert("Invalid email")
//		form.email.focus()
//		return false
//	}
	
	//Check that the phone entry is valid by first 
	//stripping off all nondigits.
//	newphone = ""
//	if (hasChar(form.phone.value)) {
//		newphone = stripNonDigits(form.phone.value)
//		notvalid = !isValid(phonexp,newphone)
//	}
//	if (newphone == "" || notvalid) {
//		alert("Invalid phone number - include area code")
//		form.phone.focus()
//		return false
//	}

	//Check that the phone entry is valid by first 
	//stripping off all any dollar sign using stripChars.
//	newpledge = ""
//	if (hasChar(form.pledge.value)) {
//		newpledge = stripChars(/\$/,form.pledge.value)
//		notvalid = !isValid(pledgexp,newpledge)
//	}
//	if (newpledge == "" || notvalid) {
//		alert("Please enter a valid dollar amount")
//		form.pledge.focus()
//		return false
//	}
	
	return true
}
//-->
