
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.Contact_FirstName.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.Contact_FirstName.focus();
    return (false);
  }

  if (theForm.Contact_FirstName.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"First Name\" field.");
    theForm.Contact_FirstName.focus();
    return (false);
  }

  if (theForm.Contact_LastName.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.Contact_LastName.focus();
    return (false);
  }

  if (theForm.Contact_LastName.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Last Name\" field.");
    theForm.Contact_LastName.focus();
    return (false);
  }

  if (theForm.Contact_StreetAddress.value == "")
  {
    alert("Please enter a value for the \"Mailing Address\" field.");
    theForm.Contact_StreetAddress.focus();
    return (false);
  }

  if (theForm.Contact_StreetAddress.value.length < 8)
  {
    alert("Please enter at least 8 characters in the \"Mailing Address\" field.");
    theForm.Contact_StreetAddress.focus();
    return (false);
  }

  if (theForm.Contact_City.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.Contact_City.focus();
    return (false);
  }

  if (theForm.Contact_City.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"City\" field.");
    theForm.Contact_City.focus();
    return (false);
  }

  if (theForm.Contact_State.value == "")
  {
    alert("Please enter a value for the \"State\" field.");
    theForm.Contact_State.focus();
    return (false);
  }

  if (theForm.Contact_State.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"State\" field.");
    theForm.Contact_State.focus();
    return (false);
  }

  if (theForm.Contact_ZipCode.value == "")
  {
    alert("Please enter a value for the \"Zip Code\" field.");
    theForm.Contact_ZipCode.focus();
    return (false);
  }

  if (theForm.Contact_ZipCode.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Zip Code\" field.");
    theForm.Contact_ZipCode.focus();
    return (false);
  }

  if (theForm.Contact_ZipCode.value.length > 12)
  {
    alert("Please enter at most 12 characters in the \"Zip Code\" field.");
    theForm.Contact_ZipCode.focus();
    return (false);
  }

  var checkOK = "0123456789-,";
  var checkStr = theForm.Contact_ZipCode.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  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 (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Zip Code\" field.");
    theForm.Contact_ZipCode.focus();
    return (false);
  }

  if (theForm.Contact_HomePhone.value == "")
  {
    alert("Please enter a value for the \"Home Phone\" field.");
    theForm.Contact_HomePhone.focus();
    return (false);
  }

  if (theForm.Contact_HomePhone.value.length < 10)
  {
    alert("Please enter at least 10 characters in the \"Home Phone\" field.");
    theForm.Contact_HomePhone.focus();
    return (false);
  }

  if (theForm.Contact_HomePhone.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"Home Phone\" field.");
    theForm.Contact_HomePhone.focus();
    return (false);
  }

  if (theForm.Undergraduate_School.value == "")
  {
    alert("Please enter a value for the \"Undergraduate School\" field.");
    theForm.Undergraduate_School.focus();
    return (false);
  }

  if (theForm.Undergraduate_School.value.length < 7)
  {
    alert("Please enter at least 7 characters in the \"Undergraduate School\" field.");
    theForm.Undergraduate_School.focus();
    return (false);
  }

  if (theForm.Referral.selectedIndex < 0)
  {
    alert("Please select one of the \"Referral\" options.");
    theForm.Referral.focus();
    return (false);
  }

  if (theForm.Referral.selectedIndex == 0)
  {
    alert("The first \"Referral\" option is not a valid selection.  Please choose one of the other options.");
    theForm.Referral.focus();
    return (false);
  }
  return (true);
}
