// JavaScript Document
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.SSN.value.length > 9)
  {
    alert("Please enter at most 9 characters in the \"SSN\" field.");
    theForm.SSN.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.SSN.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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"SSN\" field.");
    theForm.SSN.focus();
    return (false);
  }

  var chkVal = allNum;
  var prsVal = parseInt(allNum);
  if (chkVal != "" && !(prsVal >= "000000000" && prsVal <= "999999999"))
  {
    alert("Please enter a value greater than or equal to \"000000000\" and less than or equal to \"999999999\" in the \"SSN\" field.");
    theForm.SSN.focus();
    return (false);
  }
  return (true);
}
