var validateGenInfo = function(evt) {
  elemsWithErrors.each(clearErrorArray);
  elemsWithErrors = elemsWithErrors.compact();
  if ($F("full_name").blank()) {
    handleError("full_name", "Please enter your full name.", true);
  } else if ($F("title").blank()) {
    handleError("title", "Please enter your title.", true);
  } else if ($F("company").blank()) {
    handleError("company", "Please enter your company name.", true);
  } else if ($F("addr").blank()) {
    handleError("addr", "Please enter your address.", true);
  } else if ($F("city").blank()) {
    handleError("city", "Please enter your city.", true);
  } else if ($F("state").blank()) {
    handleError("state", "Please select your state", true);
  } else if ($F("zip").blank()) {
    handleError("zip", "Please enter your postal code.", true);
  } else if (!zipRegex1.test($F("zip")) &&
             !zipRegex2.test($F("zip"))) {
    handleError("zip", "Please enter your postal code in the format ##### or #####-####.", true);
  } else if ($F("phone").blank()) {
    handleError("phone", "Please enter your phone number.", true);
  } else if (!phoneRegex1.test($F("phone")) &&
             !phoneRegex2.test($F("phone")) &&
             !phoneRegex3.test($F("phone")) &&
             !phoneRegex4.test($F("phone"))) {
    handleError("phone", "Please enter your phone number in the format (###)###-####.", true);
  } else if ($F("email").blank()) {
    handleError("email", "Please enter your email address.", true);
  } else if (!emailRegex.test($F("email"))) {
    handleError("email", "Please enter a valid email address.", true);
  } else {
    return true;
  }
  evt.stop();
  return false;
}
Event.observe(window, "load", function() {
  $( "submitBtn" ).observe("click", validateGenInfo.bindAsEventListener());
});