<!--
 //QUESTIONAIRE WORD AND CHARACTER COUNTER'''''''''''''''''''''''''''''''''''''''''''''
  var submitcount=0;
  function checkSubmit() {
     if (submitcount == 0)
     {
     submitcount++;
     document.Surv.submit();
     }
  }

  function wordCounter(field, countfield, maxlimit) {
  wordcounter=0;
  for (x=0;x<field.value.length;x++) {
        // Counts the spaces while ignoring double spaces, usually one in between each word.
        if (field.value.charAt(x) == " " && field.value.charAt(x-1) != " ")  {wordcounter++} 
        if (wordcounter > 250) {field.value = field.value.substring(0, x);}
        else {countfield.value = maxlimit - wordcounter;}
        }
     }

  function textCounter(field, countfield, maxlimit) {
    if (field.value.length > maxlimit)
        {field.value = field.value.substring(0, maxlimit);}
        else
        {countfield.value = maxlimit - field.value.length;}
    }

//MAIN FORM''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function QUotePickupForm_Validator(theForm)
{

  //REQUEST DATE:
    if (theForm.Req_Date.value == "")
    {
      alert("Please enter a value for the \"Request date\" field.");
      theForm.Req_Date.focus();
      return (false);
    }

  //REQUESTED BY NAME:
    if (theForm.RequesterName.value == "")
    {
      alert("Please enter a value for the \"Requested by name\" field.");
      theForm.RequesterName.focus();
      return (false);
    }

  //MAIN PHONE:
    if (theForm.Main_Phone.value == "")
    {
      alert("Please enter a value for the \"Requested by name\" field.");
      theForm.Main_Phone.focus();
      return (false);
    }

  //EMAIL ADDRESS
    if (theForm.Email_Address.value == "")
    {
      alert("Please enter a value for the \"EmailAddress\" field.");
      theForm.Email_Address.focus();
      return (false);
    }

    //EMAILADDRESS:
      var str=theForm.Email_Address.value
      var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
        if (filter.test(str))
        testresults=true
        else{
        alert("Please input a valid email address!");
        return (false);
        }
        if (theForm.Email_Address.value.length > 48)
        {
          alert("Please enter at most 48 characters in the \"Email Address\" field.");
          theForm.EmailAddress.focus();
          return (false);
        }

  //PACKAGING:
    if ((theForm.Packaging_Pickup.checked         == false)
    &&  (theForm.Packaging_Stretchwrap.checked    == false)
    &&  (theForm.Packaging_Bubblewrap.checked     == false)
    &&  (theForm.Packaging_Palletize.checked      == false)
    &&  (theForm.Packaging_AsAppropriate.checked  == false)) 
    {
      alert("Please select a packaging method.");
      theForm.Packaging_Pickup.focus();
      return (false);
    }
 
  //ORIGINATING COMPANY NAME:
    if (theForm.Orig_Company_Name.value == "")
    {
      alert("Please enter a value for the \"Originating Company Name\" field.");
      theForm.Orig_Company_Name.focus();
      return (false);
    }

  //ORIGINATING ADDRESS:
    if (theForm.Orig_Address.value == "")
    {
      alert("Please enter a value for the \"Originating address\" field.");
      theForm.Orig_Address.focus();
      return (false);
    }

  //ORIGINATING CITY:
    if (theForm.Orig_City.value == "")
    {
      alert("Please enter a value for the \"Originating city\" field.");
      theForm.Orig_City.focus();
      return (false);
    }

  //ORIG STATE
    if (theForm.Orig_State.value == "")
    {
      alert("Please enter a value for the \"State\" field.");
      theForm.Orig_State.focus();
      return (false);
    }
    var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ";
    var checkStr = theForm.Orig_State.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 letter characters in the \"State\" field.");
      theForm.Orig_State.focus();
      return (false);
    }

  //ORIGINATING ZIP:
    if (theForm.Orig_Zip.value == "")
    {
      alert("Please enter a value for the \"Originating zip code\" field.");
      theForm.Orig_Zip.focus();
      return (false);
    }

  //Destination COMPANY NAME:
    if (theForm.Dest_Company_Name.value == "")
    {
      alert("Please enter a value for the \"Destination Company Name\" field.");
      theForm.Dest_Company_Name.focus();
      return (false);
    }

  //Destination ADDRESS:
    if (theForm.Dest_Address.value == "")
    {
      alert("Please enter a value for the \"Destination address\" field.");
      theForm.Dest_Address.focus();
      return (false);
    }

  //Destination CITY:
    if (theForm.Dest_City.value == "")
    {
      alert("Please enter a value for the \"Destination city\" field.");
      theForm.Dest_City.focus();
      return (false);
    }

  //ORIG STATE
    if (theForm.Dest_State.value == "")
    {
      alert("Please enter a value for the \"Destination State\" field.");
      theForm.Dest_State.focus();
      return (false);
    }
    var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ";
    var checkStr = theForm.Dest_State.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 letter characters in the \"Destination State\" field.");
      theForm.Dest_State.focus();
      return (false);
    }

  //Destination ZIP:
    if (theForm.Dest_Zip.value == "")
    {
      alert("Please enter a value for the \"Destination zip code\" field.");
      theForm.Dest_Zip.focus();
      return (false);
    }



  //MESSAGE1
    if (theForm.Message1.value.length == "")
    {
      alert("Please enter a value for the \"Contents and Packaging\" field.");
      theForm.Message1.focus();
      return (false);
    }
    if (theForm.Message1.value.length > 1000)
    {
      alert("Please enter a maximum of 1000 characters the \"Contents and Packaging\" field.");
      theForm.Message1.focus();
      return (false);
    }

  //MESSAGE2
    if (theForm.Message2.value.length > 1000)
    {
      alert("Please enter a maximum of 1000 characters the \"Other Information\" field.");
      theForm.Message1.focus();
      return (false);
    }

  return (true);
}
//-->