// Form Validation Script
// use  onsubmit="return form_validator(this)"  in the <form method="POST" action="confirmform.php" onsubmit="return form_validator(this)" name="form" >

function form_validator(theForm)
{

  if (theForm.x_first_name.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.x_first_name.focus();
    return (false);
  }

  if (theForm.x_first_name.value.length < 1)
  {
    alert("Please enter at least 1 character in the \"First Name\" field.");
    theForm.x_first_name.focus();
    return (false);
  }

  if (theForm.x_first_name.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"First Name\" field.");
    theForm.x_first_name.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-' \t\r\n\f";
  var checkStr = theForm.x_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 letter, whitespace and \" ' - \" characters in the \"First Name\" field.");
    theForm.x_first_name.focus();
    return (false);
  }

  if (theForm.x_last_name.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.x_last_name.focus();
    return (false);
  }

  if (theForm.x_last_name.value.length < 1)
  {
    alert("Please enter at least 1 character in the \"Last Name\" field.");
    theForm.x_last_name.focus();
    return (false);
  }

  if (theForm.x_last_name.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Last Name\" field.");
    theForm.x_last_name.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'- \t\r\n\f";
  var checkStr = theForm.x_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 letter, whitespace and \" ' - \" characters in the \"Last Name\" field.");
    theForm.x_last_name.focus();
    return (false);
  }
/*
  if (theForm.MIDDLENAME.value.length > 15)
  {
    alert("Please enter at most 15 characters in the \"Middle Name\" field.");
    theForm.MIDDLENAME.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-' \t\r\n\f";
  var checkStr = theForm.MIDDLENAME.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 letter, whitespace and \" ' - \" characters in the \"Middle Name\" field.");
    theForm.MIDDLENAME.focus();
    return (false);
  }

*/

  if (theForm.x_address.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.x_address.focus();
    return (false);
  }

  if (theForm.x_address.value.length < 1)
  {
    alert("Please enter at least 1 character in the \"Address\" field.");
    theForm.x_address.focus();
    return (false);
  }

  if (theForm.x_address.value.length > 60)
  {
    alert("Please enter at most 60 characters in the \"Address\" field.");
    theForm.x_address.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.,'#/\\-_ \t\r\n\f";
  var checkStr = theForm.x_address.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 letter, digit, whitespace and \" . , ' # / \\ - \" characters in the \"Address\" field.");
    theForm.x_address.focus();
    return (false);
  }

/*

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.,'#/\\- \t\r\n\f";
  var checkStr = theForm.ADDRESS2.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 letter, digit, whitespace and \" . , ' # / \\ - \" characters in the second \"Address\" field.");
    theForm.ADDRESS2.focus();
    return (false);
  }

  if (theForm.ADDRESS2.value.length > 25)
  {
    alert("Please enter at most 25 characters in the second \"Address\" field.");
    theForm.ADDRESS2.focus();
    return (false);
  }
  
*/  

  if (theForm.x_city.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.x_city.focus();
    return (false);
  }

  if (theForm.x_city.value.length < 1)
  {
    alert("Please enter at least 1 character in the \"City\" field.");
    theForm.CITY.focus();
    return (false);
  }

  if (theForm.x_city.value.length > 40)
  {
    alert("Please enter at most 40 characters in the \"City\" field.");
    theForm.x_city.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-' \t\r\n\f";
  var checkStr = theForm.x_city.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 letter, digit, whitespace and \" ' - \" characters in the \"City\" field.");
    theForm.x_city.focus();
    return (false);
  }

  if (theForm.x_state.selectedIndex < 0)
  {
    alert("Please select one of the \"State\" options.");
    theForm.x_state.focus();
    return (false);
  }
/*
  if (theForm.x_state.selectedIndex == 0)
  {
    alert("The first \"State\" option is not a valid selection.  Please choose one of the other options.");
    theForm.x_state.focus();
    return (false);
  }

*/
  if (theForm.x_state.value == "")
  {
    alert("Please choose one of the other \"State or Province/Territory\" options.");
    theForm.x_state.focus();
    return (false);
  }


  if (theForm.x_zip.value == "")
  {
    alert("Please enter a value for the \"Zip Code\" field.");
    theForm.x_zip.focus();
    return (false);
  }

  if (theForm.x_zip.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Zip Code\" field.");
    theForm.x_zip.focus();
    return (false);
  }

  if (theForm.x_zip.value.length > 9)
  {
    alert("Please enter at most 9 characters in the \"Zip Code\" field.");
    theForm.x_zip.focus();
    return (false);
  }

  var checkOK = "0123456789";
  var checkStr = theForm.x_zip.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 numeric characters in the \"Zip Code\" field.");
    theForm.x_zip.focus();
    return (false);
  }

  if (theForm.x_card_num.value == "")
  {
    alert("Please enter a value for the \"Credit Card Number\" field.");
    theForm.x_card_num.focus();
    return (false);
  }
/*
  if (theForm.PHONE.value.length < 10)
  {
    alert("Please enter the area code and phone number with no additional characters (10 numbers) in the \"Phone\" field.");
    theForm.PHONE.focus();
    return (false);
  }

  if (theForm.PHONE.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Phone\" field.");
    theForm.PHONE.focus();
    return (false);
  }
*/


  var checkOK = "0123456789";
  var checkStr = theForm.x_card_num.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 numeric characters in the \"Credit Card Number\" field.");
    theForm.x_card_num.focus();
    return (false);
  }


  if (theForm.x_exp_date.value == "")
  {
    alert("Please enter a value in MMYY format for the \"Expiration Date\" field.");
    theForm.x_exp_date.focus();
    return (false);
  }

  if (theForm.x_exp_date.value.length < 4)
  {
    alert("Please enter a value in MMYY format for the \"Expiration Date\" field.");
    theForm.x_exp_date.focus();
    return (false);
  }

  if (theForm.x_exp_date.value.length > 4)
  {
    alert("Please enter a value in MMYY format for the \"Expiration Date\" field.");
    theForm.x_exp_date.focus();
    return (false);
  }

  var checkOK = "0123456789";
  var checkStr = theForm.x_exp_date.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 numeric characters in the \"Expiration Date\" field.");
    theForm.x_exp_date.focus();
    return (false);
  }

  if (theForm.x_card_code.value == "")
  {
    alert("Please enter a value for the \"Card Security Code\" field.");
    theForm.x_card_code.focus();
    return (false);
  }

  if (theForm.x_card_code.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Card Security Code\" field.");
    theForm.x_card_code.focus();
    return (false);
  }

  if (theForm.x_card_code.value.length > 4)
  {
    alert("Please enter at most 4 characters in the \"Card Security Code\" field.");
    theForm.x_card_code.focus();
    return (false);
  }

  var checkOK = "0123456789";
  var checkStr = theForm.x_card_code.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 numeric characters in the \"Card Security Code\" field.");
    theForm.x_card_code.focus();
    return (false);
  }

  var checkOK = "0123456789.";
  var checkStr = theForm.x_amount.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 numeric characters and a decimal point in the \"Amount\" field.");
    theForm.x_amount.focus();
    return (false);
  }


  if (theForm.x_amount.value == "")
  {
    alert("Please enter a value for the \"Amount\" field.");
    theForm.x_amount.focus();
    return (false);
  }




/*


  if (theForm.BIRTHMONTH.selectedIndex < 0)
  {
    alert("Please select one of the \"Birth Date: Month\" options.");
    theForm.BIRTHMONTH.focus();
    return (false);
  }

  if (theForm.BIRTHMONTH.selectedIndex == 0)
  {
    alert("The first \"Birth Date: Month\" option is not a valid selection.  Please choose one of the other options.");
    theForm.BIRTHMONTH.focus();
    return (false);
  }

  if (theForm.BIRTHDAY.selectedIndex < 0)
  {
    alert("Please select one of the \"Birth Date: Day\" options.");
    theForm.BIRTHDAY.focus();
    return (false);
  }

  if (theForm.BIRTHDAY.selectedIndex == 0)
  {
    alert("The first \"Birth Date: Day\" option is not a valid selection.  Please choose one of the other options.");
    theForm.BIRTHDAY.focus();
    return (false);
  }

  if (theForm.BIRTHYEAR.selectedIndex < 0)
  {
    alert("Please select one of the \"Birth Date: Year\" options.");
    theForm.BIRTHYEAR.focus();
    return (false);
  }

  if (theForm.BIRTHYEAR.selectedIndex == 70)
  {
    alert("The initial \"Birth Date: Year\" option is not a valid selection.  Please choose one of the other options.");
    theForm.BIRTHYEAR.focus();
    return (false);
  }
  

  if (theForm.BIRTHDATE.value == "")
  {
    alert("Please enter a value for the \"Birth Date\" field.");
    theForm.BIRTHDATE.focus();
    return (false);
  }

  if (theForm.BIRTHDATE.value.length < 8)
  {
    alert("Please enter at least 8 characters in the \"Birth Date\" field.");
    theForm.BIRTHDATE.focus();
    return (false);
  }

  if (theForm.BIRTHDATE.value.length > 8)
  {
    alert("Please enter at most 8 characters in the \"Birth Date\" field.");
    theForm.BIRTHDATE.focus();
    return (false);
  }

  var checkOK = "0123456789";
  var checkStr = theForm.BIRTHDATE.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 digit characters in the \"Birth Date\" field.");
    theForm.BIRTHDATE.focus();
    return (false);
  }


  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,-' \t\r\n\f";
  var checkStr = theForm.BIRTHPLACE.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 letter, whitespace and \",./\\'-_\" characters in the \"Birth Place\" field.");
    theForm.BIRTHPLACE.focus();
    return (false);
  }

  if (theForm.SSNUM.value == "")
  {
    alert("Please enter a value for the \"Social Security Number (SSN)\" field.");
    theForm.SSNUM.focus();
    return (false);
  }

  if (theForm.SSNUM.value.length < 9)
  {
    alert("Please enter at least 9 characters in the \"Social Security Number (SSN)\" field.");
    theForm.SSNUM.focus();
    return (false);
  }

  if (theForm.SSNUM.value.length > 9)
  {
    alert("Please enter at most 9 characters in the \"Social Security Number (SSN)\" field.");
    theForm.SSNUM.focus();
    return (false);
  }

  var checkOK = "0123456789";
  var checkStr = theForm.SSNUM.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 9 numbers in the \"Social Security Number (SSN)\" field.");
    theForm.SSNUM.focus();
    return (false);
  }

  var radioSelected = false;
  for (i = 0;  i < theForm.SEX.length;  i++)
  {
    if (theForm.SEX[i].checked)
        radioSelected = true;
  }
  if (!radioSelected)
  {
    alert("Please select one of the \"Gender\" options.");
    return (false);
  }

  if (theForm.MARITALSTATUS.selectedIndex < 0)
  {
    alert("Please select one of the \"Marital Status\" options.");
    theForm.MARITALSTATUS.focus();
    return (false);
  }

  if (theForm.MARITALSTATUS.selectedIndex == 0)
  {
    alert("The first \"Marital Status\" option is not a valid selection.  Please choose one of the other options.");
    theForm.MARITALSTATUS.focus();
    return (false);
  }
  return (true);
}


  if (theForm.SPOUSENAME.value.length > 22)
  {
    alert("Please enter at most 22 characters in the \"Spouse Name\" field.");
    theForm.SPOUSENAME.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-' \t\r\n\f";
  var checkStr = theForm.SPOUSENAME.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 letter, whitespace and \" ' - \" characters in the \"Spouse Name\" field.");
    theForm.SPOUSENAME.focus();
    return (false);
  }

  if (theForm.NIE_NAME.value.length > 22)
  {
    alert("Please enter at most 22 characters in the \"Notify in Emergency Name\" field.");
    theForm.NIE_NAME.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-' \t\r\n\f";
  var checkStr = theForm.NIE_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 letter, whitespace and \" ' - \" characters in the \"Notify in Emergency Name\" field.");
    theForm.NIE_NAME.focus();
    return (false);
  }

  if (theForm.NIE_NAME.value.length > 22)
  {
    alert("Please enter at most 22 characters in the \"Notify in Emergency Name\" field.");
    theForm.NIE_NAME.focus();
    return (false);
  }


  if (theForm.NIE_RELATION.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Notify in Emergency Relation\" field.");
    theForm.NIE_RELATION.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-' \t\r\n\f";
  var checkStr = theForm.NIE_RELATION.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 letter, whitespace and \" ' - \" characters in the \"Notify in Emergency Relation\" field.");
    theForm.NIE_RELATION.focus();
    return (false);
  } 

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.,'#/\\- \t\r\n\f";
  var checkStr = theForm.NIE_ADDRESS1.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 letter, digit, whitespace and \" . , ' # / \\ - \" characters in the \"Notify in Emergency first Address\" field.");
    theForm.NIE_ADDRESS1.focus();
    return (false);
  }

  if (theForm.NIE_ADDRESS1.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"Notify in Emergency first Address\" field.");
    theForm.NIE_ADDRESS1.focus();
    return (false);
  }  

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.,'#/\\- \t\r\n\f";
  var checkStr = theForm.NIE_ADDRESS2.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 letter, digit, whitespace and \" . , ' # / \\ - \" characters in the \"Notify in Emergency second Address\" field.");
    theForm.NIE_ADDRESS2.focus();
    return (false);
  }

  if (theForm.NIE_ADDRESS2.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"Notify in Emergency second Address\" field.");
    theForm.NIE_ADDRESS2.focus();
    return (false);
  } 

  if (theForm.NIE_CITY.value.length > 13)
  {
    alert("Please enter at most 13 characters in the \"Notify in Emergency City\" field.");
    theForm.NIE_CITY.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-' \t\r\n\f";
  var checkStr = theForm.NIE_CITY.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 letter, digit, whitespace and \" ' - \" characters in the \"Notify in Emergency City\" field.");
    theForm.NIE_CITY.focus();
    return (false);
  }

  if (theForm.NIE_STATE.selectedIndex < 0)
  {
    alert("Please select one of the \"Notify in Emergency State\" options.");
    theForm.NIE_STATE.focus();
    return (false);
  }

  if (theForm.NIE_STATE.selectedIndex == 0)
  {
    alert("The first \"Notify in Emergency State\" option is not a valid selection.  Please choose one of the other options.");
    theForm.NIE_STATE.focus();
    return (false);
  }

  if (theForm.NIE_ZIP.value == "")
  {
    alert("Please enter a value for the \"Notify in Emergency Zip Code\" field.");
    theForm.NIE_ZIP.focus();
    return (false);
  }

  if (theForm.NIE_ZIP.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Notify in Emergency Zip Code\" field.");
    theForm.NIE_ZIP.focus();
    return (false);
  }

  if (theForm.NIE_ZIP.value.length > 9)
  {
    alert("Please enter at most 9 characters in the \"Notify in Emergency Zip Code\" field.");
    theForm.NIE_ZIP.focus();
    return (false);
  }

  var checkOK = "0123456789";
  var checkStr = theForm.NIE_ZIP.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 digit characters in the \"Notify in Emergency Zip Code\" field.");
    theForm.NIE_ZIP.focus();
    return (false);
  }

  if (theForm.NIE_HPHONE.value == "")
  {
    alert("Please enter a value for the \"Notify in Emergency Home Phone\" field.");
    theForm.NIE_HPHONE.focus();
    return (false);
  }

  if (theForm.NIE_HPHONE.value.length < 10)
  {
    alert("Please enter the area code and phone number with no additional characters (10 numbers) in the \"Notify in Emergency Home Phone\" field.");
    theForm.NIE_HPHONE.focus();
    return (false);
  }

  if (theForm.NIE_HPHONE.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Notify in Emergency Home Phone\" field.");
    theForm.NIE_HPHONE.focus();
    return (false);
  }

  var checkOK = "0123456789";
  var checkStr = theForm.NIE_HPHONE.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 digit characters in the \"Notify in Emergency Home Phone\" field.");
    theForm.NIE_HPHONE.focus();
    return (false);
  }

  if (theForm.NIE_WPHONE.value == "")
  {
    alert("Please enter a value for the \"Notify in Emergency Work Phone\" field.");
    theForm.NIE_WPHONE.focus();
    return (false);
  }

  if (theForm.NIE_WPHONE.value.length < 10)
  {
    alert("Please enter the area code and phone number with no additional characters (10 numbers) in the \"Notify in Emergency Work Phone\" field.");
    theForm.NIE_WPHONE.focus();
    return (false);
  }

  if (theForm.NIE_WPHONE.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Notify in Emergency Work Phone\" field.");
    theForm.NIE_WPHONE.focus();
    return (false);
  }

  var checkOK = "0123456789";
  var checkStr = theForm.NIE_WPHONE.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 digit characters in the \"Notify in Emergency Work Phone\" field.");
    theForm.NIE_WPHONE.focus();
    return (false);
  }



  if (theForm.EXPECTMONTH.selectedIndex < 0)
  {
    alert("Please select one of the \"Expected Date: Month\" options.");
    theForm.EXPECTMONTH.focus();
    return (false);
  }

  if (theForm.EXPECTMONTH.selectedIndex == 0)
  {
    alert("The first \"Expected Date: Month\" option is not a valid selection.  Please choose one of the other options.");
    theForm.EXPECTMONTH.focus();
    return (false);
  }

  if (theForm.EXPECTDAY.selectedIndex < 0)
  {
    alert("Please select one of the \"Expected Date: Day\" options.");
    theForm.EXPECTDAY.focus();
    return (false);
  }

  if (theForm.EXPECTDAY.selectedIndex == 0)
  {
    alert("The first \"Expected Date: Day\" option is not a valid selection.  Please choose one of the other options.");
    theForm.EXPECTDAY.focus();
    return (false);
  }

  if (theForm.EXPECTYEAR.selectedIndex < 0)
  {
    alert("Please select one of the \"Expected Date: Year\" options.");
    theForm.EXPECTYEAR.focus();
    return (false);
  }

  if (theForm.EXPECTYEAR.selectedIndex == 0)
  {
    alert("The first \"Expected Date: Year\" option is not a valid selection.  Please choose one of the other options.");
    theForm.EXPECTYEAR.focus();
    return (false);
  }
  
*/

}//END FORM VALIDATION   