// validate the form

function Validator(theForm)
{
	var error = ""; 
	var digits = "0123456789 ";
 
	if (theForm.name.value == "")
	{
		error += "Please fill in your Name.\n";
	}
	
	if (theForm.tel.value == "")
	{
		error += "Please fill in your Telephone Number.\n";
	}
	if (theForm.address.value == "")
	{
		error += "Please fill in your Address.\n";
	}
	if (theForm.hearselect.value == "")
	{
		error += "Can you tell us How you Found us.\n";
	}
	for (var i = 0; i < theForm.tel.value.length; i++)
	{
		temp = theForm.tel.value.substring(i, i+1)

		if (digits.indexOf(temp) == -1 && 
			theForm.tel.value != "")
		{
			error += "The Telephone Number must be a number.\n";
			break;
		}
	}
	
	
	if (theForm.email.value == "")
	{
		error += "You must include an Email address for a response.\n";
	}
	
	if ((theForm.email.value.indexOf ('@',0) == -1 ||
		theForm.email.value.indexOf ('.',0) == -1) &&
		theForm.email.value != "")
	{
		error += "Please verify that your email address is valid.\n";
	} 
	
	
	if (error != "")
	{
		alert(error);
		return (false);
	} 
	
}
/*
function validateForm(objForm)
{
	var returnStatus = 1;

	if (objForm.hearselect.selectedIndex == 0) {
		alert("Please Let us know how you found us");
		returnStatus = 0;
	};

	if (returnStatus) {
		objForm.submit();
	}
}
*/