function Form_Validator(theForm)
{

//CONTACT NAME:
  if (theForm.ContactName.value == "")
  {
    alert("Please enter a value for the \"Contact name\" field.");
    theForm.ContactName.focus();
    return (false);
  }

  if (theForm.ContactName.value.length > <%=CONTACT_FORM_WRAPLEN - CONTACT_FORM_TABPOS%>)
  {
    alert("Contact Name too long!");
    theForm.ContactName.focus();
    return (false);
  }

//EMAIL ADDRESS:
  if (theForm.ContactEmail.value == "")
  {
    alert("Please enter a value for the \"Contact Email Address\" field.");
    theForm.ContactEmail.focus();
    return (false);
  }

  var str=theForm.ContactEmail.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.ContactEmail.value.length > <%=CONTACT_FORM_WRAPLEN - CONTACT_FORM_TABPOS%>)
  {
    alert("Email address too long!");
    theForm.ContactEmail.focus();
    return (false);
  }


//BUS NAME:
  if (theForm.BusinessName.value == "")
  {
    alert("Please enter a value for the \"Business name\" field.");
    theForm.BusinessName.focus();
    return (false);
  }

//BUS FEDERAL IDE:
  if (theForm.BusinessFederalID.value == "")
  {
    alert("Please enter a value for the \"Federal ID\" field.");
    theForm.BusinessFederalID.focus();
    return (false);
  }

  if (theForm.BusinessAddress.value == "")
  {
    alert("Please enter a value for the \"Business address\" field.");
    theForm.BusinessAddress.focus();
    return (false);
  }

  if (theForm.BusinessCity.value == "")
  {
    alert("Please enter a value for the \"Business City\" field.");
    theForm.BusinessCity.focus();
    return (false);
  }

  if (theForm.BusinessState.value == "")
  {
    alert("Please enter a value for the \"Business State\" field.");
    theForm.BusinessState.focus();
    return (false);
  }

  if (theForm.BusinessZip.value == "")
  {
    alert("Please enter a value for the \"Business Zip\" field.");
    theForm.BusinessZip.focus();
    return (false);
  }

  if (theForm.BusinessZip.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Business Zip\" field.");
    theForm.BusinessZip.focus();
    return (false);
  }

  if (theForm.BusinessZip.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Business Zip\" field.");
    theForm.BusinessZip.focus();
    return (false);
  }

  var checkOK = "0123456789--";
  var checkStr = theForm.BusinessZip.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 and \"-\" characters in the \"Business Zip\" field.");
    theForm.BusinessZip.focus();
    return (false);
  }

  if (theForm.BusinessPhone.value == "")
  {
    alert("Please enter a value for the \"Business Phone\" field.");
    theForm.BusinessPhone.focus();
    return (false);
  }



//BILLING INFORMATION:
  if (theForm.BillingState.value == "")
  {
    alert("Please enter a value for the \"Billing State\" field.");
    theForm.BillingState.focus();
    return (false);
  }

  if (theForm.BillingZip.value == "")
  {
    alert("Please enter a value for the \"Billing Zip\" field.");
    theForm.BillingZip.focus();
    return (false);
  }

  if (theForm.BillingZip.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Billing Zip\" field.");
    theForm.BillingZip.focus();
    return (false);
  }

  if (theForm.BillingZip.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Billing Zip\" field.");
    theForm.BillingZip.focus();
    return (false);
  }

  var checkOK = "0123456789--";
  var checkStr = theForm.BillingZip.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 and \"-\" characters in the \"Billing Zip\" field.");
    theForm.BillingZip.focus();
    return (false);
  }


//REFERENCES:
  if (theForm.ReferenceName1.value == "")
  {
    alert("Please enter a value for the \"Reference Name 1\" field.");
    theForm.ReferenceName1.focus();
    return (false);
  }

  if (theForm.ReferenceZip1.value == "")
  {
    alert("Please enter a value for the \"Reference Zip 1\" field.");
    theForm.ReferenceZip1.focus();
    return (false);
  }

  if (theForm.ReferenceZip1.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Reference Zip 1\" field.");
    theForm.ReferenceZip1.focus();
    return (false);
  }

  if (theForm.ReferenceZip1.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Reference Zip 1\" field.");
    theForm.ReferenceZip1.focus();
    return (false);
  }

  var checkOK = "0123456789--";
  var checkStr = theForm.ReferenceZip1.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 and \"-\" characters in the \"Reference Zip 1\" field.");
    theForm.ReferenceZip1.focus();
    return (false);
  }

  if (theForm.ReferenceName2.value == "")
  {
    alert("Please enter a value for the \"Reference Name 2\" field.");
    theForm.ReferenceName2.focus();
    return (false);
  }

  if (theForm.ReferenceZip2.value == "")
  {
    alert("Please enter a value for the \"Reference Zip 2\" field.");
    theForm.ReferenceZip2.focus();
    return (false);
  }

  if (theForm.ReferenceZip2.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Reference Zip 2\" field.");
    theForm.ReferenceZip2.focus();
    return (false);
  }

  if (theForm.ReferenceZip2.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Reference Zip 2\" field.");
    theForm.ReferenceZip2.focus();
    return (false);
  }

  var checkOK = "0123456789--";
  var checkStr = theForm.ReferenceZip2.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 and \"-\" characters in the \"Reference Zip 2\" field.");
    theForm.ReferenceZip2.focus();
    return (false);
  }

  if (theForm.ReferenceName3.value == "")
  {
    alert("Please enter a value for the \"Reference Name 3\" field.");
    theForm.ReferenceName3.focus();
    return (false);
  }

  if (theForm.ReferenceZip3.value == "")
  {
    alert("Please enter a value for the \"Reference Zip 3\" field.");
    theForm.ReferenceZip3.focus();
    return (false);
  }

  if (theForm.ReferenceZip3.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Reference Zip 3\" field.");
    theForm.ReferenceZip3.focus();
    return (false);
  }

  if (theForm.ReferenceZip3.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Reference Zip 3\" field.");
    theForm.ReferenceZip3.focus();
    return (false);
  }

  var checkOK = "0123456789--";
  var checkStr = theForm.ReferenceZip3.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 and \"-\" characters in the \"Reference Zip 3\" field.");
    theForm.ReferenceZip3.focus();
    return (false);
  }
  return (true);
}
//-->
