 <script language="JavaScript" type="text/javascript"><!--
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.employees.value == "")
  {
    alert("Please enter a value for the \"Employees\" field.");
    theForm.employees.focus();
    return (false);
  }

  if (theForm.employees.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Employees\" field.");
    theForm.employees.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.employees.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 \"Employees\" field.");
    theForm.employees.focus();
    return (false);
  }

  var chkVal = allNum;
  var prsVal = parseInt(allNum);
  if (chkVal != "" && !(prsVal > 0))
  {
    alert("Please enter a value greater than \"0\" in the \"Employees\" field.");
    theForm.employees.focus();
    return (false);
  }

  if (theForm.minutesonline.value == "")
  {
    alert("Please enter a value for the \"Minutes Spent Online\" field.");
    theForm.minutesonline.focus();
    return (false);
  }

  if (theForm.minutesonline.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Minutes Spent Online\" field.");
    theForm.minutesonline.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.minutesonline.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 \"Minutes Spent Online\" field.");
    theForm.minutesonline.focus();
    return (false);
  }

  var chkVal = allNum;
  var prsVal = parseInt(allNum);
  if (chkVal != "" && !(prsVal > 0))
  {
    alert("Please enter a value greater than \"0\" in the \"Minutes Spent Online\" field.");
    theForm.minutesonline.focus();
    return (false);
  }

  if (theForm.salary.value == "")
  {
    alert("Please enter a value for the \"Average Salary per Hour\" field.");
    theForm.salary.focus();
    return (false);
  }

  if (theForm.salary.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Average Salary per Hour\" field.");
    theForm.salary.focus();
    return (false);
  }

  var checkOK = "0123456789-.";
  var checkStr = theForm.salary.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 += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Average Salary per Hour\" field.");
    theForm.salary.focus();
    return (false);
  }

  if (decPoints > 1 || !validGroups)
  {
    alert("Please enter a valid number in the \"salary\" field.");
    theForm.salary.focus();
    return (false);
  }

  var chkVal = allNum;
  var prsVal = parseFloat(allNum);
  if (chkVal != "" && !(prsVal > 0))
  {
    alert("Please enter a value greater than \"0\" in the \"Average Salary per Hour\" field.");
    theForm.salary.focus();
    return (false);
  }
  return (true);
}
//--></script>

