
function validateForm(formObject){
	try {
		if (isBlank(formObject.ContactName)) {
			alert("Please enter your name.");
			return false;
		}
		if (isBlank(formObject.Company)) {
			alert("Please enter your company.");
			return false;
		}
		if (!validateEmail(formObject.send_from.value)) {
			alert("Please enter a valid email address.");
			return false;
		}
		alert("Your request has been sent.");
		return true;
	}
	catch(err) {
	   txt="JS:There was an error on this page.\n\n";
	   txt+="Error description: " + err.description + "\n\n";
	   txt+="Click OK to continue.\n\n";
	   alert(txt);
	   return false;
	}
}

function isBlank(checkField) {
	if (checkField.value.length == 0) {
		return true;
	}
	else {
		return false;
	}
}

function validateEmail( strValue) {
/************************************************
DESCRIPTION: Validates that a string contains a
  valid email pattern.

 PARAMETERS:
   strValue - String to be tested for validity

RETURNS:
   True if valid, otherwise false.

REMARKS: Accounts for email with country appended
  does not validate that email contains valid URL
  type (.com, .gov, etc.) or valid country suffix.
*************************************************/
var objRegExp  =
 /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

  //check for valid email
  return objRegExp.test(strValue);
}