  var scatArry = new Array();
  var z = 0;
  var pz = 0;

  function loadscat()
  {
    scatArry[1] = new Array('',"No SubCategory");
    scatArry[2] = new Array('',"No SubCategory");
    scatArry[3] = new Array('',"No SubCategory");
    scatArry[4] = new Array('',"No SubCategory");
    scatArry[5] = new Array('',"No SubCategory");
    scatArry[6] = new Array('',"No SubCategory");
    scatArry[7] = new Array('',"No SubCategory");
    scatArry[8] = new Array('',"Cellular");
    scatArry[9] = new Array('',"Hardware","Software");
    scatArry[10] = new Array('',"No SubCategory");
    scatArry[11] = new Array('',"Colleges","Computer Centres","Polytechnics","Schools","Technical Institutes");
    scatArry[12] = new Array('',"No SubCategory");
    scatArry[13] = new Array('',"Cinema","Clubs","Dance","Drama");
    scatArry[14] = new Array('',"Banks","Forex");
    scatArry[15] = new Array('',"No SubCategory");
    scatArry[16] = new Array('',"Bakeries","Hotels","Ice Creams");
    scatArry[17] = new Array('',"No SubCategory");
    scatArry[18] = new Array('',"No SubCategory");
    scatArry[19] = new Array('',"No SubCategory");
    scatArry[20] = new Array('',"No SubCategory");
    scatArry[21] = new Array('',"Doctors","Hospitals","Medical Shops");
    scatArry[22] = new Array('',"Exterior","Interior");
    scatArry[23] = new Array('',"Email Providers","Internet Appliances","Internet Cafes","Internet Service Providers","Portals","Web Site Designers","Web Site Hosting");
    scatArry[24] = new Array('',"No SubCategory");
    scatArry[25] = new Array('',"No SubCategory");
    scatArry[26] = new Array('',"Civil","Criminal");
    scatArry[27] = new Array('',"Folk","Karnatic","Western");
    scatArry[28] = new Array('',"No SubCategory");
    scatArry[29] = new Array('',"No SubCategory");
    scatArry[30] = new Array('',"No SubCategory");
    scatArry[31] = new Array('',"No SubCategory");
    scatArry[32] = new Array('',"No SubCategory");
    scatArry[33] = new Array('',"No SubCategory");
    scatArry[34] = new Array('',"No SubCategory");
    scatArry[35] = new Array('',"No SubCategory");
    scatArry[36] = new Array('',"Builders");
    scatArry[37] = new Array('',"No SubCategory");
    scatArry[38] = new Array('',"No SubCategory");
    scatArry[39] = new Array('',"No SubCategory");
    scatArry[40] = new Array('',"No SubCategory");
    scatArry[41] = new Array('',"No SubCategory");
    scatArry[42] = new Array('',"Travel Agents");
    scatArry[43] = new Array('',"No SubCategory");
    scatArry[44] = new Array('',"Courier","Kalyana Mahals","Laboratories");

    var cat = document.forms[0].cat;
    var scat = document.forms[0].scat;

    for(var i=0; i<cat.length; i++ )
    {
      if(cat.options[i].selected)
      {
        z = i;
      }
    }

    if ((pz != z) && (z != 0))
    {
      pz = z;

      for (var k = scat.length - 1; k >= 0; k-- )
      {
        scat.options[k] = null;
      }
      selectedItem = "Select a sub Category";
      scat.options[scat.length] = new Option( selectedItem, selectedItem );

      for (var h=1; h<scatArry[z].length; h++)
      {
        selectedItem = scatArry[z][h];
        scat.options[scat.length] = new Option( selectedItem, selectedItem );
      }
      scat.options[0].selected = scat.options[0].text
    }

    else if ((z == 0))
    {
      pz = z;
      for (var k = scat.length - 1; k >= 0; k-- )
      {
        scat.options[k] = null;
      }
      selectedItem = "Category is required";
      scat.options[scat.length] = new Option( selectedItem, selectedItem );
    }
  }

  function Form_Validation(theform)
  {
    var cat = document.forms[0].cat;
    var scat = document.forms[0].scat;
    var temp = document.Reg_Form.scat.selectedIndex;

    if (theform.cname.value == "")
    {
      alert ("Enter Company Name") ;
      theform.cname.focus() ;
      return false ;
    }
    else
    {
      document.Reg_Form.tscat.value = temp;
    }

    for(var i=0; i<cat.length; i++ )
    {
      if(cat.options[i].selected)
      {
        var z=i;
      }
    }
    if (z == 0)
    {
      alert ("Select the Category") ;
      theform.cat.focus() ;
      return false ;
    }
    for(var i=0; i<scat.length; i++ )
    {
      if(scat.options[i].selected)
      {
        var y=i;
      }
    }
    if (y == 0)
    {
      alert ("Select the Sub Category") ;
      theform.scat.focus() ;
      return false ;
    }

    if (theform.cperson.value == "")
    {
      alert ("Enter Contact Person Name") ;
      theform.cperson.focus() ;
      return false ;
    }
    if (theform.designatn.value == "")
    {
      alert ("Enter Designation") ;
      theform.designatn.focus() ;
      return false ;
    }
    if (theform.doorno.value == "")
    {
      alert ("Enter Door No.") ;
      theform.doorno.focus() ;
      return false ;
    }
    if (theform.street.value == "")
    {
      alert ("Enter Street Name") ;
      theform.street.focus() ;
      return false ;
    }
    if (isNaN(theform.pincode.value))
    {
      alert("Enter only Numeric Values") ;
      theform.pincode.focus() ;
      return false ;
    }
    if (theform.pincode.value.length < 6)
    {
      alert ("Enter 6 digit Zip or PIN") ;
      theform.pincode.focus() ;
      return false ;
    }
    if (theform.email.value == "" || theform.email.value.indexOf('@',0) == -1 || theform.email.value.indexOf('.',0) == -1)
    {
      alert ("Enter Email Address") ;
      theform.email.value == "";
      theform.email.focus() ;
      return false ;
    }
/*    if (isNaN(theform.cyear.value))
    {
      alert("Enter only Numeric Values") ;
      theform.cyear.focus() ;
      return false ;
    }
    if (theform.cyear.value.length < 4)
    {
      alert ("Enter 4 digit Year") ;
      theform.cyear.focus() ;
      return false ;
    }*/
    if (theform.products.value == "")
    {
      alert ("Enter Company Product(s)") ;
      theform.products.focus() ;
      return false ;
    }

    theform.cmdSubmit.value = "Submitting...";
    theform.cmdSubmit.disabled = true;
    return true;
  }
