function verify(contact) {
	//check to see if the name field is blank
	if (contact.name.value == "") {
        alert("Please enter your name.")
		contact.name.focus()
		contact.name.select()
		return false
	}
	//check the email address using validEmail function
	if (contact.email.value == "") {
        alert("Please enter your email address.")
		contact.email.focus()
		contact.email.select()
		return false		
	} else if (!validEmail(contact.email.value)) {
		alert("You must enter a valid email address.")
		contact.email.focus()
		contact.email.select()
		return false
	}	
	//check to see if the name field is blank
	if (contact.question.value == "") {
        alert("Please ask a question.")
		contact.question.focus()
		contact.question.select()
		return false
	}
}	



// Check zip
function validZip(zip) {
		invalidChars = ":,;`~!@#$%^&*()_=[]{}\|/<>.+abcdefghigklmnopqrstuvwxyz"
		// check for bad charcters
		for (i=0; i < invalidChars.length; i++) {
		 	// does it contain any invalid characters?
			badChar = invalidChars.charAt(i)
			if (zip.indexOf(badChar,0) > -1) {
				return false
			}
		}
		// at least 5 characters
		if (zip.length < 5)	{
			return false
		}
		return true;
	}
// Check phone
function validPhone(phone) {
		invalidChars = ":,;`~!@#$%^&*_=[]{}\|/<>.+abcdefghigklmnopqrstuvwxyz"
		// check for bad charcters
		for (i=0; i < invalidChars.length; i++) {
		 	// does it contain any invalid characters?
			badChar = invalidChars.charAt(i)
			if (phone.indexOf(badChar,0) > -1) {
				return false
			}
		}
		// at least 9 characters
		if (phone.length < 9)	{
			return false
		}
		return true;
	}
// Check email address
function validEmail(email) {
		invalidChars = " /:,;"

		for (i=0; i < invalidChars.length; i++) {
		 	// does it contain any invalid characters?
			badChar = invalidChars.charAt(i)
			if (email.indexOf(badChar,0) > -1) {
				return false
			}
		}
		atPos = email.indexOf("@",1)
		// there must be one "@" symbol
		if (atPos == -1) {
			return false
		}
		if (email.indexOf("@",atPos+1) != -1) {
			// and only one "@" symbol
			return false
		}
		periodPos = email.indexOf(".",atPos)
		if (periodPos == -1) {
			// and at least one "." after the "@"
			return false
		}
		if (periodPos + 3 > email.length)	{
			// must be at least 2 characters after the "."
			return false
		}
		return true;
	}