function validateForm(theForm)

{

var tmpFld = new String("");
var discrepMsg = new String("");
var tmpStr;
var strChar;
var blnResult = false;

try
{

	// First+Last Name
	tmpFld = theForm.txtName.value; 
	if (tmpFld.length == 0)
	{
		theForm.txtName.focus();
		alert("Please enter your First and Last names.");
		return false;
	} 

	// Address
	//tmpFld = theForm.txtAddress.value; 
	//if (tmpFld.length == 0)
	//{
	//	theForm.txtAddress.focus();
	//	alert("Please enter a valid Street Address.");
	//	return false;
	//}
	
	// City
	tmpFld = theForm.txtCity.value; 
	if (tmpFld.length == 0)
	{
		theForm.txtCity.focus();
		alert("Please enter a valid City.");
		return false;
	}
		
	// State
	if (theForm.ddStates.value == "(Select One)") {
		theForm.ddStates.focus();
		alert("Please select a valid State.");
		return false;
	}
					
	// Zip
	tmpFld = theForm.txtZip.value; 
	if (tmpFld.length == 0)
	{
		theForm.txtZip.focus();
		alert("Please enter a Zipcode for your address.");
		return false;
	}	
			
	/////////////////////////////////////////////////////////////////
	// Ensure that a phone number is entered...
	/////////////////////////////////////////////////////////////////	
	// Phone
	//tmpFld = theForm.txtPhoneAC.value;
	//if (tmpFld.length != 3)
	//{
	//	theForm.txtPhoneAC.focus();
	//	alert("Please enter your telephone Area Code.");
	//	return false;
	//}
	//else {
	//	if (isNumber(tmpFld) == false) {
	//		theForm.txtPhoneAC.focus();
	//		alert("Please enter a valid Telephone Area Code");
	//		return false;
	//	}
	//}		

	//tmpFld = theForm.txtPhonePrefix.value;
	//if (tmpFld.length != 3)
	//{
	//	theForm.txtPhonePrefix.focus();
	//	alert("Please enter your telephone Prefix.");
	//	return false;
	//}
	//else {
	//	if (isNumber(tmpFld) == false) {
	//		theForm.txtPhonePrefix.focus();
	//		alert("Please enter a valid Telephone Prefix");
	//		return false;
	//	}
	//}			
	
	//tmpFld = theForm.txtPhoneSuffix.value;
	//if (tmpFld.length != 4)
	//{
	//	theForm.txtPhoneSuffix.focus();
	//	alert("Please enter the last 4 digits of your telephone number.");
	//	return false;
	//}	
	//else {
	//	if (isNumber(tmpFld) == false) {
	//		theForm.txtPhoneSuffix.focus();
	//		alert("Please enter the last 4-digits of your Telephone Number");
	//		return false;
	//	}
	//}	
	
	/////////////////////////////////////////////////////////////////
	// Ensure that email address is entered...
	/////////////////////////////////////////////////////////////////
	tmpFld = theForm.txtEMail.value;
	if (!validate_email(tmpFld)) {
		theForm.txtEMail.focus();
		alert("Please enter a valid EMail address.");
		return false;
	} 
			
	return true;
} 

catch(exception)
{ 

	if (exception.description == null)
	{ 
		alert("Error: " + exception.message); 

	} 

	else
	{ 
		alert("Error in processing Contact Request: " + exception.description); 
	}

}

return false;

} 

function isNumber(value) {
	for (var i=0; i < value.length; i++) {
		a = parseInt(value.charAt(i));
		if (isNaN(a)) {
			return false;			
			break;
		}
	}
	return true;
}

function validate_email(e)
{
apos=e.indexOf("@")
dotpos=e.lastIndexOf(".")
if (apos<1||dotpos-apos<2) { 
  return false;
}
else {
	return true;
}
}
