function validate() {

	if ((document.Form1.category[document.Form1.category.selectedIndex].value != "0") && (document.Form1.newcategory.value != ""))
	{
		alert("Please enter only one Service.")
		document.Form1.category.focus();
		return false;
	}
	
	if ((document.Form1.category[document.Form1.category.selectedIndex].value == "0") && (document.Form1.newcategory.value == ""))
	{
		alert("Please select the Service.")
		document.Form1.category.focus();
		return false;
	}
	
	if (document.Form1.company.value == "")
	{
		alert("Please enter the Business Name.")
		document.Form1.company.focus();
		return false;
	}
	if (document.Form1.contact.value == "")
	{
		alert("Please enter the Contact.")
		document.Form1.contact.focus();
		return false;
	}
	if (document.Form1.address.value == "")
	{
		alert("Please enter the Address.")
		document.Form1.address.focus();
		return false;
	}
	if (document.Form1.address.value.length > 150)
  {
    alert("Please enter at the most 150 characters in the Address 1 field.");
    document.Form1.address.focus();
    return (false);
  }  

if (document.Form1.postcode.value == "")
  {
    alert("Please enter Zip/Pincode.");
    document.Form1.postcode.focus();
    return (false);
  }

  if (document.Form1.postcode.value.length > 20)
  {
    alert("Please enter at the most 20 characters in the Zip/Pincode field.");
    document.Form1.postcode.focus();
    return (false);
  }
  
  if (document.Form1.city.value == "")
  {
    alert("Please enter the name of your City.");
    document.Form1.city.focus();
    return (false);
  }

var checkOK = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
  var checkStr = document.Form1.city.value;
  var allValid = 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 != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only alphabets in the City field.");
    document.Form1.city.focus();
    return (false);
  }

  if (document.Form1.city.value.length < 3)
  {
    alert("Please enter atleast 3 characters in the City field.");
    document.Form1.city.focus();
    return (false);
  }  

  var checkOK = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
    var checkStr = document.Form1.state.value;
    var allValid = 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 != ",")
        allNum += ch;
    }
    if (!allValid)
    {
      alert("Please enter only alphabets in the State field.");
      document.Form1.state.focus();
      return (false);
    }    
    
	if (document.Form1.phone.value == "")
	{
		alert("Please enter the Phone.")
		document.Form1.phone.focus();
		return false;
	}
	if (document.Form1.email.value == "")
	{
		alert("Please enter the Email.")
		document.Form1.email.focus();
		return false;
	}
	if (document.Form1.details.value == "")
	{
		alert("Please enter the Details.")
		document.Form1.details.focus();
		return false;
	}
	if (document.Form1.hear.value == "")
	{
		alert("Please enter from where did you hear about us.");
		document.Form1.hear.focus();
  		return false;
	} 
}