// JavaScript Document
/*
Purpose of this file is to make sure that:
	- check that all important fields have been entered
	- email field contains x@x.x or better
	- first name field contains at least one character
	- last name field is optional
	- location is optional
	- comments - must have at least two characters
	- refer - optional

*/

function validate()
{
	theform=window.document.contact
	atcheck=theform.email.value.indexOf("@")
	submitOK="True"

	if (theform.name.value.length < 2)
		{
			alert("Please fill in your name.")
			submitOK="False"
		}
		
	if ((theform.email.value.length < 6) || (atcheck == -1))
		{
			alert("Please fill in your email address.")
			submitOK="False"
		}
		
	if  ((theform.name.value.length > 40) || (theform.email.value.length > 40) || (theform.location.value.length > 40) || (theform.comments.value.length > 3000))
		{
			alert("Unspecified Error")
			submitOK = "False"
		}
		
	if (theform.comments.value.length < 10)
		{
			alert("Please completely fill in your comments before submitting the form.")
			submitOK = "False"
		}

	if (submitOK == "False")
		{
			return false
		}
}