function Form_Validator(theForm)
  {
    var demofail 
    demofail = 0

    if (theForm.strFirstName.value == "")
      {
        alert("Please enter a value for the \"First Name\" field.");
        theForm.strFirstName.focus();
        return (false);
      }
    if (theForm.strLastName.value == "")
      {
        alert("Please enter a value for the \"Last Name\" field.");
        theForm.strLastName.focus();
        return (false);
      }
    if (theForm.strAddress1_1.value == "")
      {
        alert("Please enter a value for the \"Address\" field.");
        theForm.strAddress1_1.focus();
        return (false);
      }
    if (theForm.strCity.value == "")
      {
        alert("Please enter a value for the \"City\" field.");
        theForm.strCity.focus();
        return (false);
      }
    if (theForm.strDummy1.options[theForm.strDummy1.selectedIndex].value == "--")
      {
        alert("Please select a valid \"State\".");
        theForm.strDummy1.focus();
        return (false);
      }
    else
      {
        var str = theForm.strDummy1.options[theForm.strDummy1.selectedIndex].value;
        theForm.strState.value = str.substring(0,2);
        theForm.lngForeignStCode.value = str.substring(2);
      }
    
    if (str.substring(2) == "061") 
      {
        if (
          ((theForm.strZip.value.substring(0, 3) > "089") && (theForm.strZip.value.substring(0, 3) < "093")) ||
          ((theForm.strZip.value.substring(0, 3) > "093") && (theForm.strZip.value.substring(0, 3) < "100"))
          ) 
          {
          }
        else 
          {
            alert("Your postal code does not match the selected state")
            theForm.strZip.focus();
            return (false);
          }
      }
    else if (str.substring(2) == "062") 
      {
        if (theForm.strZip.value.substring(0, 3) != "093") 
          {
            alert("Your postal code does not match the selected state")
            theForm.strZip.focus();
            return (false);
          }
      }
    else if (str.substring(2) == "063") 
      {
        if ((theForm.strZip.value.substring(0, 3) < "962") || (theForm.strZip.value.substring(0, 3) > "966")) 
          {
            alert("Your postal code does not match the selected state")
            theForm.strZip.focus();
            return (false);
          }
      }
    else if (str.substring(2) == "064") 
      {
        if (theForm.strZip.value.substring(0, 3) != "340") 
          {
            alert("Your postal code does not match the selected state")
            theForm.strZip.focus();
            return (false);
          }
      }

    if (theForm.strZip.value == "")
      {
        alert("Please enter a value for the \"Zip Code\" field.");
        theForm.strZip.focus();
        return (false);
      }
    if (theForm.strZip.value.length != 5)
      {
        alert("Please enter 5 characters in the \"Zip Code\" field.");
        theForm.strZip.focus();
        return (false);
      }

    var checkOK = "0123456789";
    var checkStr = theForm.strZip.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 \"Zip Code\" field.");
        theForm.strZip.focus();
        return (false);
      }

    if (theForm.strPhone.value == "")
      { }
    else 
      {
        if (theForm.strPhone.value.length != 10) 
          {
            alert("Please enter 10 digits in the \"Phone\" field.  Enter only numbers, no spaces or dashes.");
            theForm.strPhone.focus();
            return (false);
          }
      }
    if (theForm.strFax.value == "")
      { }
    else 
      {
        if (theForm.strFax.value.length != 10) 
          {
            alert("Please enter 10 digits in the \"Fax\" field.  Enter only numbers, no spaces or dashes.");
            theForm.strFax.focus();
            return (false);
          }
      }
    if (theForm.strCompany.value == "")
      {
        alert("Please enter a value for the \"Establishment\" field.");
        theForm.strCompany.focus();
        return (false);
      }
    if (theForm.strCompany.value.length > 35)
      {
        alert("Please enter at most 35 characters in the \"Establishment\" field.");
        theForm.strCompany.focus();
        return (false);
      }
    if (theForm.strEmail.value == "")
      {
        alert("Please enter a value for the \"Email\" field.");
        theForm.strEmail.focus();
        return (false);
      }

    var strEmail = theForm.strEmail.value;
    var i=strEmail.indexOf("@");	//see if there's an @ sign
    var x=strEmail.indexOf("@",i+1); //make sure there's not more @ signs
    var p=strEmail.indexOf(".",i);  //there must be a period 
    if ( (i==-1) || (p<(i+2)) || (x>i) || (p >=(strEmail.length - 2)))
      {
        alert("Please enter a valid Email Address.");
        theForm.strEmail.focus();
        return(false);
      }
    if (theForm.strEmail.value.length > 65)
      {
        alert("Please enter at most 65 characters in the \"Email\" field.");
        theForm.strEmail.focus();
        return (false);
      }
    if (theForm.lngPriIndCode.options[theForm.lngPriIndCode.selectedIndex].value == "--")
      {
        alert("Please select a valid \"Type of Establishment\" option.");
        theForm.lngPriIndCode.focus();
        return (false);
      }
    if (theForm.lngPriIndCode.options[theForm.lngPriIndCode.selectedIndex].value == "60")
      if (theForm.strPriIndCodeOther.value.length == 0)
        {
          alert("Please specify Type of Establishment");
          theForm.strPriIndCodeOther.focus();
          return (false);
        }
    if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "--")
      {
        alert("Please select a valid \"Title\" option.");
        theForm.lngTitle.focus();
        return (false);
      }
    if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "060")
      if (theForm.strTitleOther.value.length == 0)
        {
          alert("Please specify your title");
          theForm.strTitleOther.focus();
          return (false);
        }

    if (theForm.strTitleLiteral.value == "")
      {
        if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "060")
          {
            theForm.strTitleLiteral.value = theForm.strTitleOther.value
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "001")
          {
            theForm.strTitleLiteral.value = "Owner"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "002")
          {
            theForm.strTitleLiteral.value = "Executive Chef"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "003")
          {
            theForm.strTitleLiteral.value = "Chef"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "004")
          {
            theForm.strTitleLiteral.value = "General Manager"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "005")
          {
            theForm.strTitleLiteral.value = "Caterer"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "006")
          {
            theForm.strTitleLiteral.value = "Party Planner"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "007")
          {
            theForm.strTitleLiteral.value = "Kitchen Manager"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "008")
          {
            theForm.strTitleLiteral.value = "Banquet Manager"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "009")
          {
            theForm.strTitleLiteral.value = "Restaurant Manager"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "010")
          {
            theForm.strTitleLiteral.value = "Catering Director"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "011")
          {
            theForm.strTitleLiteral.value = "Food/Beverage Director"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "012")
          {
            theForm.strTitleLiteral.value = "Club Manager"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "013")
          {
            theForm.strTitleLiteral.value = "Hotel Director"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "014")
          {
            theForm.strTitleLiteral.value = "Purchasing Agent"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "015")
          {
            theForm.strTitleLiteral.value = "Bar Manager"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "016")
          {
            theForm.strTitleLiteral.value = "Wine Steward"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "017")
          {
            theForm.strTitleLiteral.value = "Food/Wine Writer, Editor"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "018")
          {
            theForm.strTitleLiteral.value = "Consultant"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "019")
          {
            theForm.strTitleLiteral.value = "Educator"
          }
        else if (theForm.lngTitle.options[theForm.lngTitle.selectedIndex].value == "020")
          {
            theForm.strTitleLiteral.value = "Restaurant Designer"
          }
      }

    if (theForm.strTitleLiteral.value.length > 35)
      {
        alert("Please enter at most 35 characters in the \"Title\" field.");
        theForm.strTitleLiteral.focus();
        return (false);
      }

    if (theForm.strVerificationQuestion.options[theForm.strVerificationQuestion.selectedIndex].value == "--")
      {
        alert("Please select a valid \"Eye Color\" option.");
        theForm.strVerificationQuestion.focus();
        return (false);
      }
  
    if (demofail == 0)
      {
      }
    else
      {
        theForm.lnglist.value = "7"
      }
      theForm.blnProcess.value = 1;
      return (true);
  }
