function Form_Validator(theForm)
{

  if (theForm.FirstName.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.FirstName.focus();
    return (false);
  }

  if (theForm.LastName.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.LastName.focus();
    return (false);
  }

  var checkOK = "0123456789-.,";
  var checkStr = theForm.StudentID.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 if (ch == "," && decPoints != 0)
    {
      validGroups = false;
      break;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Student ID\" field.");
    theForm.StudentID.focus();
    return (false);
  }

  if (decPoints > 1 || !validGroups)
  {
    alert("Please enter a valid number in the \"StudentID\" field.");
    theForm.StudentID.focus();
    return (false);
  }

  if (theForm.StudentEmail.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.StudentEmail.focus();
    return (false);
  }

  if (theForm.Question.value == "")
  {
    alert("Please enter a value for the \"Question\" field.");
    theForm.Question.focus();
    return (false);
  }
  return (true);
}