function form_val_contact(theForm)
{
	// check to see if the last name field is blank
	if (theForm.first_name.value == "")
	{
		alert("Please enter your first name!");
		theForm.first_name.focus();
		return (false);
	}
	
	// allow ONLY alphanumeric keys, no symbols or punctuation
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
	var checkStr = theForm.first_name.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length)
		{
			allValid = false;
			break;
		}
	}
	if (!allValid)
	{
		alert("Please enter only alphabets in the First Name field!");
		theForm.first_name.focus();
		return (false);
	}
	
	
	// check to see if the last name field is blank
	if (theForm.last_name.value == "")
	{
		alert("Please enter your last name!");
		theForm.last_name.focus();
		return (false);
	}
	
	// allow ONLY alphanumeric keys, no symbols or punctuation
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
	var checkStr = theForm.last_name.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length)
		{
			allValid = false;
			break;
		}
	}
	if (!allValid)
	{
		alert("Please enter only alphabets in the Last Name field!");
		theForm.last_name.focus();
		return (false);
	}
	
	
	// check if email field is blank
	if (theForm.email_address.value == "")
	{
		alert("Please enter an email address.");
		theForm.email_address.focus();
		return (false);
	}
	
	
	// test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = theForm.email_address.value;
	var EmailValid = false;
	var EmailAt = false;
	var EmailPeriod = false;
	for (i = 0;  i < checkStr.length;  i++)
	{
	ch = checkStr.charAt(i);
	for (j = 0;  j < checkEmail.length;  j++)
	{
	if (ch == checkEmail.charAt(j) && ch == "@")
	EmailAt = true;
	if (ch == checkEmail.charAt(j) && ch == ".")
	EmailPeriod = true;
		  if (EmailAt && EmailPeriod)
			break;
		  if (j == checkEmail.length)
			break;
		}
		// if both the @ and . were in the string
	if (EmailAt && EmailPeriod)
	{
			EmailValid = true
			break;
		}
	}
	if (!EmailValid)
	{
	alert("The \"Email\" provided is invalid!");
	theForm.email_address.focus();
	return (false);
	}
	
	//phone validation
	// check to see if the tel no field is blank
	if (theForm.phone_no.value != "")
	{
		// allow ONLY numeric keys, one symbol -
		var checkOK = "0123456789- ";
		var checkStr = theForm.phone_no.value;
		var allValid = true;
		for (i = 0;  i < checkStr.length;  i++)
		{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length)
		{
		allValid = false;
		break;
		}
		}
		if (!allValid)
		{
		alert("Please enter only numbers in the Phone No field.");
		theForm.phone_no.focus();
		return (false);
		}
	}

	// check to see if the first name field is blank
	if (theForm.subject.value == "")
	{
	alert("Please enter a subject!");
	theForm.subject.focus();
	return (false);
	}

	// check to see if the first name field is blank
	if (theForm.message.value == "")
	{
	alert("Please enter a message!");
	theForm.message.focus();
	return (false);
	}

}//end function




