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
	}	
/*
	if (contact.phone.value == "") {
        alert("Please enter your phone number.")
		contact.phone.focus()
		contact.phone.select()
		return false		
	} else if (!validPhone(contact.phone.value)) {
		alert("You must enter a valid phone number.")
		contact.phone.focus()
		contact.phone.select()
		return false
	}	
*/
}	

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

	if (booking.phone.value == "") {
        alert("Please enter your phone number.")
		booking.phone.focus()
		booking.phone.select()
		return false		
	} else if (!validPhone(booking.phone.value)) {
		alert("You must enter a valid phone number.")
		booking.phone.focus()
		booking.phone.select()
		return false
	}	

	//check to see if the date_of_event field is blank
	if (booking.date_of_event.value == "") {
        alert("Please enter the date of the event.")
		booking.date_of_event.focus()
		booking.date_of_event.select()
		return false
	}

}	

function verify_press_kit(press_kit) {

	//check the email address using validEmail function
	if (press_kit.email.value == "") {
        alert("Please enter your email address.")
		press_kit.email.focus()
		press_kit.email.select()
		return false		
	} else if (!validEmail(press_kit.email.value)) {
		alert("You must enter a valid email address.")
		press_kit.email.focus()
		press_kit.email.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;
	}