
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.name.value == "")
  {
    alert("Please enter a value for the \"name\" field.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.name.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"name\" field.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.company.value == "")
  {
    alert("Please enter a value for the \"company\" field.");
    theForm.company.focus();
    return (false);
  }

  if (theForm.company.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"company\" field.");
    theForm.company.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 < 1)
  {
    alert("Please enter at least 1 characters in the \"email\" field.");
    theForm.email.focus();
    return (false);
  }

  if (theForm.phone.value == "")
  {
    alert("Please enter a value for the \"phone\" field.");
    theForm.phone.focus();
    return (false);
  }

  var checkOK = "0123456789--";
  var checkStr = theForm.phone.value;
  var allValid = true;
  var validGroups = 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 and \"-\" characters in the \"phone\" field.");
    theForm.phone.focus();
    return (false);
  }

  if (theForm.Description.value == "")
  {
    alert("Please enter a value for the \"Description\" field.");
    theForm.Description.focus();
    return (false);
  }

  if (theForm.Description.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Description\" field.");
    theForm.Description.focus();
    return (false);
  }
  return (true);
}

