
function applicantform_Validator(theForm)
{

  if (theForm.fFname.value == "")
  {
    alert("Please enter your first name.");
    theForm.fFname.focus();
    return (false);
  }

  if (theForm.fFname.value.length > 30)
  {
    alert("Please enter at most 30 characters in the \"First Name\" field.");
    theForm.fFname.focus();
    return (false);
  }

  if (theForm.fLname.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.fLname.focus();
    return (false);
  }

  if (theForm.fLname.value.length > 40)
  {
    alert("Please enter at most 40 characters in the \"Last Name\" field.");
    theForm.fLname.focus();
    return (false);
  }
  
    if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length > 60)
  {
    alert("Please enter at most 60 characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Residency.selectedIndex < 0)
  {
    alert("Please select one of the \"Residency\" options.");
    theForm.residency.focus();
    return (false);
  }

  if (theForm.Street.value == "")
  {
    alert("Please enter a value for the \"Street\" field.");
    theForm.Street.focus();
    return (false);
  }

  if (theForm.Street.value.length > 60)
  {
    alert("Please enter at most 60 characters in the \"Street\" field.");
    theForm.Street.focus();
    return (false);
  }

  if (theForm.City.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.City.value.length > 40)
  {
    alert("Please enter at most 40 characters in the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.State.value == "")
  {
    alert("Please enter a value for the \"State\" field.");
    theForm.State.focus();
    return (false);
  }

  if (theForm.State.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"State\" field.");
    theForm.State.focus();
    return (false);
  }

  if (theForm.State.value.length > 18)
  {
    alert("Please enter at most 18 characters in the \"State\" field.");
    theForm.State.focus();
    return (false);
  }
  
  if (theForm.Country.value == "")
  {
    alert("Please enter a value for the \"Country\" field.");
    theForm.Country.focus();
    return (false);
  }

  if (theForm.Country.value.length > 38)
  {
    alert("Please enter at most 38 characters in the \"Country\" field.");
    theForm.Country.focus();
    return (false);
  }

  if (theForm.Zip.value == "")
  {
    alert("Please enter a value for the \"Zip\" field.");
    theForm.Zip.focus();
    return (false);
  }

  if (theForm.Zip.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Zip\" field.");
    theForm.Zip.focus();
    return (false);
  }

  if (theForm.Zip.value.length > 15)
  {
    alert("Please enter at most 15 characters in the \"Zip\" field.");
    theForm.Zip.focus();
    return (false);
  }

  if (theForm.HomePhone.value == "")
  {
    alert("Please enter a value for the \"HomePhone\" field.");
    theForm.HomePhone.focus();
    return (false);
  }

  if (theForm.HomePhone.value.length > 40)
  {
    alert("Please enter at most 40 characters in the \"HomePhone\" field.");
    theForm.HomePhone.focus();
    return (false);
  }

  var checkOK = "0123456789-()-.# \t\r\n\f";
  var checkStr = theForm.HomePhone.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, whitespace and \"()-.#\" characters in the \"HomePhone\" field.");
    theForm.HomePhone.focus();
    return (false);
  }

  if (theForm.AltPhone.value.length > 40)
  {
    alert("Please enter at most 40 characters in the \"AltPhone\" field.");
    theForm.AltPhone.focus();
    return (false);
  }

  var checkOK = "0123456789-()-.# \t\r\n\f";
  var checkStr = theForm.AltPhone.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, whitespace and \"()-.#\" characters in the \"AltPhone\" field.");
    theForm.AltPhone.focus();
    return (false);
  }

  if (theForm.WorkPhone.value.length > 40)
  {
    alert("Please enter at most 40 characters in the \"WorkPhone\" field.");
    theForm.WorkPhone.focus();
    return (false);
  }

  var checkOK = "0123456789-()-.# \t\r\n\f";
  var checkStr = theForm.WorkPhone.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, whitespace and \"()-.#\" characters in the \"WorkPhone\" field.");
    theForm.WorkPhone.focus();
    return (false);
  }


  

  
  /*
  var checkOK = "@";
  var checkStr = theForm.Email.value;
  var allValid = 0;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
	  {allValid = 1 + allValid; 
       }
	}
  if (allValid !== 1)
  {
    alert("Please enter a valid Email address");
    theForm.Email.focus();
    return (false);
  }
  
  var checkOK = ".";
  var checkStr = theForm.Email.value;
  var allValid = 0;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
	  {allValid = 1 + allValid; 
       }
	}
  if (allValid < 1)
  {
    alert("Please enter a valid Email address");
    theForm.Email.focus();
    return (false);
  }
  */
  
  
  if (theForm.CurrentEmployer.value == "")
  {
    alert("Please enter a value for the \"CurrentEmployer\" field.");
    theForm.CurrentEmployer.focus();
    return (false);
  }

  if (theForm.CurrentEmployer.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"CurrentEmployer\" field.");
    theForm.CurrentEmployer.focus();
    return (false);
  }

  if (theForm.CurrentTitle.value == "")
  {
    alert("Please enter a value for the \"CurrentTitle\" field.");
    theForm.CurrentTitle.focus();
    return (false);
  }

  if (theForm.CurrentTitle.value.length > 40)
  {
    alert("Please enter at most 40 characters in the \"CurrentTitle\" field.");
    theForm.CurrentTitle.focus();
    return (false);
  }

  if (theForm.Degrees.value == "")
  {
    alert("Please enter a value for the \"Degrees\" field.");
    theForm.Degrees.focus();
    return (false);
  }

  if (theForm.Degrees.value.length > 70)
  {
    alert("Please enter at most 70 characters in the \"Degrees\" field.");
    theForm.Degrees.focus();
    return (false);
  }

  if (theForm.LastSalary.value == "")
  {
    alert("Please enter a value for the \"LastSalary\" field.");
    theForm.LastSalary.focus();
    return (false);
  }

  if (theForm.LastSalary.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"LastSalary\" field.");
    theForm.LastSalary.focus();
    return (false);
  }
  
  var checkOK = "0123456789-.\t\r\n\f";
  var checkStr = theForm.LastSalary.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 digits and decimals in the \"LastSalary\" field.");
    theForm.LastSalary.focus();
    return (false);
  }

if (theForm.BonusLastYear.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"BonusLastYear\" field.");
    theForm.BonusLastYear.focus();
    return (false);
  }
  
  var checkOK = "0123456789-.\t\r\n\f";
  var checkStr = theForm.BonusLastYear.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 digits and decimals in the \"BonusLastYear\" field.");
    theForm.BonusLastYear.focus();
    return (false);
  }
  
  if (theForm.TotalCurrent.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"TotalCurrent\" field.");
    theForm.TotalCurrent.focus();
    return (false);
  }
  
  var checkOK = "0123456789-.\t\r\n\f";
  var checkStr = theForm.TotalCurrent.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 digits and decimals in the \"TotalCurrent\" field.");
    theForm.TotalCurrent.focus();
    return (false);
  }
  
    if (theForm.DesiredSalary.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"DesiredSalary\" field.");
    theForm.DesiredSalary.focus();
    return (false);
  }
  
  var checkOK = "0123456789-.\t\r\n\f";
  var checkStr = theForm.DesiredSalary.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 digits and decimals in the \"DesiredSalary\" field.");
    theForm.DesiredSalary.focus();
    return (false);
  }
  
  if (theForm.MinimumSalary.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"MinimumSalary\" field.");
    theForm.MinimumSalary.focus();
    return (false);
  }
  
  var checkOK = "0123456789-.\t\r\n\f";
  var checkStr = theForm.MinimumSalary.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 digits and decimals in the \"MinimumSalary\" field.");
    theForm.MinimumSalary.focus();
    return (false);
  }
    
  var radioSelected = false;
  for (i = 0;  i < theForm.Location1.length;  i++)
  {
    if (theForm.Location1[i].checked)
        radioSelected = true;
  }
  
  return (true);
}