
function submittal_Validator(theForm)
{

if (theForm.badboy.value.length > 0)
  {
     alert('badboy');
	 return (false);
  }
  
  if (theForm.firstName.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.firstName.focus();
    return (false);
  }

  if (theForm.firstName.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"First Name\" field.");
    theForm.firstName.focus();
    return (false);
  }

  if (theForm.firstName.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"First Name\" field.");
    theForm.firstName.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'/-,. \t\r\n\f";
  var checkStr = theForm.firstName.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 letter, whitespace and \"`'/-,.\" characters in 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);
  }

  if (theForm.lastName.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Last Name\" field.");
    theForm.lastName.focus();
    return (false);
  }

  if (theForm.lastName.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"Last Name\" field.");
    theForm.lastName.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'`-,. \t\r\n\f";
  var checkStr = theForm.lastName.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 letter, whitespace and \"'`-,.\" characters in the \"Last Name\" field.");
    theForm.lastName.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-,/.-\\ \t\r\n\f";
  var checkStr = theForm.faxNumber.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 letter, digit, whitespace and \",/.-\\\" characters in the \"Fax Number\" field.");
    theForm.faxNumber.focus();
    return (false);
  }

if (theForm.telephoneNumber.value == "")
  {
    alert("Please enter a value for the \"Telephone Number\" field.");
    theForm.telephoneNumber.focus();
    return (false);
  }

  if (theForm.telephoneNumber.value.length < 9)
  {
    alert("Please enter at least 9 characters in the \"Telephone Number\" field.");
    theForm.telephoneNumber.focus();
    return (false);
  }

  if (theForm.telephoneNumber.value.length > 20)
  {
    alert("You phone number appears to be invalid \"Telephone Number\" field.");
    theForm.telephoneNumber.focus();
    return (false);
  }


var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-,/.-\\ \t\r\n\f";
  var checkStr = theForm.telephoneNumber.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 letter, digit, whitespace and \",/.-\\\" characters in the \"Telephone Number\" field.");
    theForm.telephoneNumber.focus();
    return (false);
  }

   if (theForm.firmName.value == "")
  {
    alert("Please enter a value for the \"Firm Name\" field.");
    theForm.firmName.focus();
    return (false);
  }

  if (theForm.firmName.value.length > 40)
  {
    alert("Please enter at most 40 characters in the \"Firm Name\" field.");
    theForm.firmName.focus();
    return (false);
  }
  
  if (theForm.projectName.value == "")
  {
    alert("Please enter a value for the \"Project Name\" field.");
    theForm.projectName.focus();
    return (false);
  }

  if (theForm.projectName.value.length > 40)
  {
    alert("Please enter at most 40 characters in the \"Project Name\" field.");
    theForm.projectName.focus();
    return (false);
  }

if (theForm.projectAddress.value == "")
  {
    alert("Please enter a value for the \"Project Address\" field.");
    theForm.projectAddress.focus();
    return (false);
  }
  
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-'/-,. \t\r\n\f";
  var checkStr = theForm.projectAddress.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 letter, digit, whitespace and \"`'/-,.\" characters in the \"Project Address\" field.");
    theForm.projectAddress.focus();
    return (false);
  }

if (theForm.projectCity.value == "")
  {
    alert("Please enter a value for the \"Project City\" field.");
    theForm.projectCity.focus();
    return (false);
  }
  
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'/-., \t\r\n\f";
  var checkStr = theForm.projectCity.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 letter, whitespace and \"`'/-.,\" characters in the \"Project City\" field.");
    theForm.projectCity.focus();
    return (false);
  }

  if (theForm.projectState.selectedIndex < 0)
  {
    alert("Please select one of the \"Project_state\" options.");
    theForm.projectState.focus();
    return (false);
  }

if (theForm.projectZipCode.value == "")
  {
    alert("Please enter a value for the \"Project Zipcode\" field.");
    theForm.projectZipCode.focus();
    return (false);
  }
  
  var checkOK = "0123456789-.,";
  var checkStr = theForm.projectZipCode.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 \"Project Zip Code\" field.");
    theForm.projectZipCode.focus();
    return (false);
  }

  if (decPoints > 1 || !validGroups)
  {
    alert("Please enter a valid number in the \"Project_zip\" field.");
    theForm.projectZipCode.focus();
    return (false);
  }

    return (true);
}


