function validate() {

var radioSelected = false;
  for (i = 0;  i < document.Form1.level.length;  i++)
  {
    if (document.Form1.level[i].checked)
        radioSelected = true;
  }
  if (!radioSelected)
  {
    alert("Please select the Membership option.");
    document.Form1.level[0].focus();
    return (false);
  }
  
if (document.Form1.firstname.value == "")
{
	alert("Please enter your First Name.")
	document.Form1.firstname.focus();
	return false;
}

var checkOK = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
  var checkStr = document.Form1.firstname.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 First Name field.");
    document.Form1.firstname.focus();
    return (false);
  }

if (document.Form1.lastname.value == "")
{
	alert("Please enter your Last Name.")
	document.Form1.lastname.focus();
	return false;
}

var checkOK = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
  var checkStr = document.Form1.lastname.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 Last Name field.");
    document.Form1.lastname.focus();
    return (false);
  }
  

  if (document.Form1.address.value == "")
  {
    alert("Please enter your 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);
    }
    
    var radioSelected = false;
  for (i = 0;  i < document.Form1.gender.length;  i++)
  {
    if (document.Form1.gender[i].checked)
        radioSelected = true;
  }
  if (!radioSelected)
  {
    alert("Please select one of the Gender options.");
    document.Form1.gender[0].focus();
    return (false);
  }
  
  var checkOK = "0123456789";
  var checkStr = document.Form1.telephone_h1.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 numbers in the Phone field.");
	document.Form1.telephone_h1.focus();
    return false;
}

var checkOK = "0123456789";
  var checkStr = document.Form1.telephone_h2.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 numbers in  the Phone field.");
	document.Form1.telephone_h2.focus();
    return false;
}

var checkOK = "0123456789";
  var checkStr = document.Form1.telephone_h3.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 numbers in the Phone field.");
	document.Form1.telephone_h3.focus();
    return false;
}  
  
  if (document.Form1.hear.value == "")
{
	alert("Please enter from where did you hear about us.");
	document.Form1.hear.focus();
  	return false;
}  
}