
function requestinfoform_Validator(theForm)
{

  if (theForm.Prefix.selectedIndex < 0)
  {
    alert("Please select one of the \"Prefix\" options.");
    theForm.Prefix.focus();
    return (false);
  }

  if (theForm.Prefix.selectedIndex == 0)
  {
    alert("The first \"Prefix\" option is not a valid selection.  Please choose one of the other options.");
    theForm.Prefix.focus();
    return (false);
  }

  if (theForm.CompanyName.value == "")
  {
    alert("Please enter a value for the \"CompanyName\" field.");
    theForm.CompanyName.focus();
    return (false);
  }

  if (theForm.CompanyName.value.length > 30)
  {
    alert("Please enter at most 30 characters in the \"CompanyName\" field.");
    theForm.CompanyName.focus();
    return (false);
  }

  if (theForm.FirstName.value == "")
  {
    alert("Please enter a value for the \"FirstName\" field.");
    theForm.FirstName.focus();
    return (false);
  }

  if (theForm.FirstName.value.length > 30)
  {
    alert("Please enter at most 30 characters in the \"FirstName\" field.");
    theForm.FirstName.focus();
    return (false);
  }

  if (theForm.LastName.value == "")
  {
    alert("Please enter a value for the \"LastName\" field.");
    theForm.LastName.focus();
    return (false);
  }

  if (theForm.LastName.value.length > 40)
  {
    alert("Please enter at most 40 characters in the \"LastName\" field.");
    theForm.LastName.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.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.Phone.value == "")
  {
    alert("Please enter a value for the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }

  if (theForm.Phone.value.length > 40)
  {
    alert("Please enter at most 40 characters in the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }

  var checkOK = "0123456789-()-.# \t\r\n\f";
  var checkStr = theForm.Phone.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 \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }

  if (theForm.Fax.value.length > 40)
  {
    alert("Please enter at most 40 characters in the \"Fax\" field.");
    theForm.Fax.focus();
    return (false);
  }

  var checkOK = "0123456789-()-.# \t\r\n\f";
  var checkStr = theForm.Fax.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 \"Fax\" field.");
    theForm.Fax.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);
  }
  
  
  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);
  }
  
  
  return (true);
}
