// JavaScript Document

function formValidation(theForm)
{

var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";

	if (theForm.contact_name.value == "")
	{
		alert("The \"Name of Contact\" field is required.");
		theForm.contact_name.focus();
		return false;
	}
	
	for (var i = 0; i < theForm.contact_name.value.length; i++) 
      		if (iChars.indexOf(theForm.contact_name.value.charAt(i)) != -1) 
               	{
               		alert ("Your Contact Name entry contains special characters. \nPlease remove any of the following characters: \n @ ! # $ % ^ & * ( ) + = - [ ] \ \\ ' ; , .  /  { } |  \" : < > ?.\n");
                	theForm.contact_name.focus();
					return (false);
        	}
			

			
	if (theForm.contact_email.value == "")
	{
		alert("The \"Email Address\" field is required.");
		theForm.contact_email.focus();
		return false;
	}
	
	
	if(!isValidEmailStrict(theForm.contact_email.value))
	{
		alert("You must enter a valid Email Address.");
		theForm.contact_email.focus();
		return false;
	} 
	
	if (theForm.contact_phone.value == "")
	{
		alert("The \"Telephone Number\" field is required.");
		theForm.contact_phone.focus();
		return false;
	}
	
	if (!isNumeric(theForm.contact_phone.value))
		{
			alert("The \"Telephone Number\" field must be only numbers.\n\nCorrect: 3335551212\n\nIncorrect : 333-555-1212 or (333) 555-1212");
			theForm.contact_phone.focus();
			return false;
		}
	
	
	if (theForm.contact_time.value == "")
	{
		alert("The \"Contact Time\" field is required.");
		theForm.contact_time.focus();
		return false;
	}
	
	
	for (var i = 0; i < theForm.contact_time.value.length; i++) 
      		if (iChars.indexOf(theForm.contact_time.value.charAt(i)) != -1) 
               	{
               		alert ("Your Contact Time entry contains special characters. \nPlease remove any of the following characters: \n @ ! # $ % ^ & * ( ) + = - [ ] \ \\ ' ; , .  /  { } |  \" : < > ?.\n");
                	theForm.contact_time.focus();
					return (false);
        	}
			
			
	return true;
}