function Form_Validator(theForm)
  {
    var strcheckstr
    if (theForm.strFirstName.value == "")
      {
        alert("Please enter a value for the \"First Name\" field.");
        theForm.strFirstName.focus();
        return (false);
      }
    isContainSpacesOrTab(theForm.strFirstName.value);
    if (!result)
      {
        alert('Please enter a valid value for your First Name.');
        theForm.strFirstName.focus();
        return (false);
      }
    strcheckstr = theForm.strFirstName.value.substring(0,1);
    if (strcheckstr == " ")
      {
        alert("Please enter a valid 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);
      }
    isContainSpacesOrTab(theForm.strLastName.value);
    if (!result)
      {
        alert('Please enter a valid value for the \"Last Name\" field.');
        theForm.strLastName.focus();
        return (false);
      }
    strcheckstr = theForm.strLastName.value.substring(0,1);
    if (strcheckstr == " ")
      {
        alert("Please enter a valid value for the \"Last Name\" field.");
        theForm.strLastName.focus();
        return (false);
      }
    if (theForm.strCompany.value == "")
      {
        alert("Please enter a value for the \"Company\" field.");
        theForm.strCompany.focus();
        return (false);
      }
    if (theForm.strCompany.value.length < 3)
      {
        alert('Please enter a valid value for your Company.');
        theForm.strCompany.focus();
        return (false);
      }
    isContainSpacesOrTab(theForm.strCompany.value);
    if (!result)
      {
        alert('Please enter a valid value for the \"Company\" field.');
        theForm.strCompany.focus();
        return (false);
      }
    strcheckstr = theForm.strCompany.value.substring(0,1);
    if (strcheckstr == " ")
      {
        alert("Please enter a valid value for the \"Company\" field.");
        theForm.strCompany.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.strAddress1_1.value.length < 6)
      {
        alert('Please enter a valid value for your Address.');
        theForm.strAddress1_1.focus();
        return (false);
      }
    isContainSpacesOrTab(theForm.strAddress1_1.value);
    if (!result)
      {
        alert('Please enter a valid value for the \"Address\" field.');
        theForm.strAddress1_1.focus();
        return (false);
      }
    strcheckstr = theForm.strAddress1_1.value.substring(0,1);
    if (strcheckstr == " ")
      {
        alert("Please enter a valid 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);
      }
    isContainSpacesOrTab(theForm.strCity.value);
    if (!result)
      {
        alert('Please enter a valid value for the \"City\" field.');
        theForm.strCity.focus();
        return (false);
      }
    strcheckstr = theForm.strCity.value.substring(0,1);
    if (strcheckstr == " ")
      {
        alert("Please enter a valid value for the \"City\" field.");
        theForm.strCity.focus();
        return (false);
      }
    if (theForm.lngDomFor[0].checked == true)
      {
        var str = theForm.strDummy1.options[theForm.strDummy1.selectedIndex].value;
        if (theForm.strDummy1.options[theForm.strDummy1.selectedIndex].value == "--")
          {
            alert("Please select a valid \"State\".");
            theForm.strDummy1.focus();
            return (false);
          }
        if (str.substring(2) > "079")
          {
            alert("Please select a valid \"State\" for USA address.");
            theForm.strDummy1.focus();
            return (false);
          }
        theForm.strState.value = str.substring(0,2);
        theForm.lngForeignStCode.value = str.substring(2);
        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 == "")
          {
            alert("Please enter a value for the \"Phone\" field.");
            theForm.strPhone.focus();
            return (false);
          }
        if (theForm.strPhone.value.length > 0)
          {
            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.strPhone.value.length > 10)
          {
            alert("Please enter at most 10 digits in the \"Phone\" field.  Enter only numbers, no spaces or dashes.");
            theForm.strPhone.focus();
            return (false);
          }
        isContainSpacesOrTab(theForm.strPhone.value);
        if (!result)
          {
            alert('Please enter a valid value for the \"Phone\" field.');
            theForm.strPhone.focus();
            return (false);
          }
        strcheckstr = theForm.strPhone.value.substring(0,1);
        if (strcheckstr == " ")
          {
            alert("Please enter a valid value for the \"Phone\" field.");
            theForm.strPhone.focus();
            return (false);
          } 
        if (theForm.strFax.value.length > 0)
          {
            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.strFax.value.length > 10)
          {
            alert("Please enter at most 10 digits in the \"Fax\" field.  Enter only numbers, no spaces or dashes.");
            theForm.strFax.focus();
            return (false);
          }
        isContainSpacesOrTab(theForm.strFax.value);
        if (!result)
          {
            alert('Please enter a valid value for the \"Fax\" field.');
            theForm.strFax.focus();
            return (false);
          }
      }
    else if(theForm.lngDomFor[1].checked == true)
      {	
        var str = theForm.strDummy1.options[theForm.strDummy1.selectedIndex].value;
        if (theForm.strDummy1.options[theForm.strDummy1.selectedIndex].value == "")
          {
            alert("Please select a valid \"Province\".");
            theForm.strDummy1.focus();
            return (false);
          }
        if (str.substring(2) < "080")
          {
            alert("Please select a valid \"Province\" for Canada address.");
            theForm.strDummy1.focus();
            return (false);
          }
        theForm.strState.value = str.substring(0,2);
        theForm.lngForeignStCode.value = str.substring(2);
        if (theForm.strPhone.value == "")
          {
            alert("Please enter a value for the \"Phone\" field.");
            theForm.strPhone.focus();
            return (false);
          }
        if (theForm.strPhone.value.length > 10)
          {
            alert("Please enter at most 10 digits in the \"Phone\" field.  Enter only numbers, no spaces or dashes.");
            theForm.strPhone.focus();
            return (false);
          }
        isContainSpacesOrTab(theForm.strPhone.value);
        if (!result)
          {
            alert('Please enter a valid value for the \"Phone\" field.');
            theForm.strPhone.focus();
            return (false);
          }
        strcheckstr = theForm.strPhone.value.substring(0,1);
        if (strcheckstr == " ")
          {
            alert("Please enter a valid value for the \"Phone\" field.");
            theForm.strPhone.focus();
            return (false);
          } 
        if (theForm.strFax.value.length > 10)
          {
            alert("Please enter at most 10 digits in the \"Fax\" field.  Enter only numbers, no spaces or dashes.");
            theForm.strFax.focus();
            return (false);
          }
        isContainSpacesOrTab(theForm.strFax.value);
        if (!result)
          {
            alert('Please enter a valid value for the \"Fax\" field.');
            theForm.strFax.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 != 6)
          {
            alert("Please enter 6 characters in the \"Zip Code\" field.");
            theForm.strZip.focus();
            return (false);
          }
        var checkOK = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        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 digits and characters A-Z in the \"Zip Code\" field.");
            theForm.strZip.focus();
            return (false);
          }
      }
    else if(theForm.lngDomFor[2].checked == true)
      {
        if (theForm.lngDummy1.options[theForm.lngDummy1.selectedIndex].value == "")
          {
            alert("Please select a valid \"Country\".");
            theForm.lngDummy1.focus();
            return (false);
          }
        else
          {
            theForm.strState.value = "";
            theForm.lngForeignStCode.value = theForm.lngDummy1.options[theForm.lngDummy1.selectedIndex].value;
          }
        if (theForm.strPhone.value == "")
          {
            alert("Please enter a value for the \"Phone\" field.");
            theForm.strPhone.focus();
            return (false);
          }
        if (theForm.strPhone.value.length > 15)
          {
            alert("Please enter at most 15 digits in the \"Phone\" field.  Enter only numbers, no spaces or dashes.");
            theForm.strPhone.focus();
            return (false);
          }
        isContainSpacesOrTab(theForm.strPhone.value);
        if (!result)
          {
            alert('Please enter a valid value for the \"Phone\" field.');
            theForm.strPhone.focus();
            return (false);
          }
        strcheckstr = theForm.strPhone.value.substring(0,1);
        if (strcheckstr == " ")
          {
            alert("Please enter a valid value for the \"Phone\" field.");
            theForm.strPhone.focus();
            return (false);
          } 
        if (theForm.strFax.value.length > 15)
          {
            alert("Please enter at most 15 digits in the \"Fax\" field.  Enter only numbers, no spaces or dashes.");
            theForm.strFax.focus();
            return (false);
          }
        isContainSpacesOrTab(theForm.strFax.value);
        if (!result)
          {
            alert('Please enter a valid value for the \"Fax\" field.');
            theForm.strFax.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 > 10)
          {
            alert("Please enter no more than 10 characters in the \"Zip Code\" field.");
            theForm.strZip.focus();
            return (false);
          }
/*    
        var checkOK = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        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);
          }
*/
      } 
    else
      {
        alert ("Please select a \"Country\" option.");
        theForm.lngDomFor[0].focus()
        return (false);
      }
    if (theForm.strEmail.value == "")
      {
        alert("Please enter a value for the \"Email\" field.");
        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);
      }
    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);
      }
    isContainSpacesOrTab(theForm.strEmail.value);
    if (!result)
      {
        alert('Please enter a valid value for the \"Email\" field..');
        theForm.strEmail.focus();
        return (false);
      }
    strcheckstr = theForm.strEmail.value.substring(0,1);
    if (strcheckstr == " ")
      {
        alert("Please enter a valid value for the \"Email\" field.");
        theForm.strEmail.focus();
        return (false);
      }

  //validate phone
  var checkOK = "0123456789";
  var checkStr = theForm.strPhone.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 \"Phone\" field.");
      theForm.strPhone.focus();
      return (false);
    }

  //validate fax
  if (theForm.strFax.value.length >= 1)
    {
      var checkOK = "0123456789";
      var checkStr = theForm.strFax.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 \"Fax\" field.");
          theForm.strFax.focus();
          return (false);
        }
    }
  
    if (theForm.strEffortKey.value == "")
      {
        theForm.strEffortKey.value = theForm._strEffortKey.value
 //       alert("Please enter a value for the \"Effort Key\" field.");
 //       theForm.strEffortKey.focus();
 //       return (false);
      }
    if (theForm.strEffortKey.value.length < 6)
      {
        alert("Please enter a valid value for the \"Effort Key\" field.");
        theForm.strEffortKey.focus();
        return (false);
      }

    if (theForm.DEMOlngMultiDemo.options[theForm.DEMOlngMultiDemo.selectedIndex].value == "06")
      {
        if (theForm.strMisc2Lit10G.value == "")
          {
            alert("Please enter an Other value for how you heard about this product.");
            theForm.strMisc2Lit10G.focus();
            return (false);
          }
      }
 
    theForm.blnProcess.value = 1;
    return (true);
  }


function isContainSpacesOrTab(val)
  {
    //var result = true;
    
    if(val==null){return false;} 
    if(val.length==0) {return false;} 
    for(i=0; i<val.length; i++) 
      {
        if ((val.charAt(i) =="\n") || (val.charAt(i) =="\r") || (val.charAt(i) =="\t")) 
          {
            result = false;
            break;
          }
        else
          {result = true;}
      }
  }
  
function show(object)
  { 
    if (object == "06")
      {
        document.getElementById('strMisc2Lit10G').disabled = false;
      }
    else
      {
        document.getElementById('strMisc2Lit10G').disabled = true;
      }
  }  
