function showsubcategories(catID)
{
document.getElementById('category_error').innerHTML='';
document.getElementById('catidvalue').value=catID;
var cityID=document.getElementById('cityidvalue').value;
//window.alert("Calling in city id is"+cityID);
//window.alert("Calling in showcat: id is"+catID);
var xmlHttp;
   try
      { 
       
       xmlHttp = new XMLHttpRequest();
       }
     catch (e)
      { 
        try
        {
        xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
         }
      
         catch (e)
         {   
            try
            {      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");  
             }
             catch (e)
                {     
                 return false;   
                }  
         } 
     }
 
  random = Math.random() * Date.parse(new Date()); 
 
  var url="./getsubcategoriesjson?catID="+catID+"&cityID="+cityID+"&rand="+random;
 
   xmlHttp.open("GET", url , true );
   
   
   xmlHttp.onreadystatechange= function()
    {
    if(xmlHttp.readyState==4 && xmlHttp.status == 200)
      {
       
         var subCategories = eval( "(" +xmlHttp.responseText + ")" );   
	    var boxHtml="";
	    var paging="";
	   var len = subCategories.resultset.length;
	  //  window.alert("len is:"+len);
	 if( len <= 0){
	 
	   document.getElementById('subcategorydiv').innerHTML="";
	   }else{
	   
	
	    for(var i=0;i<len;i++)
	    {
	     boxHtml+=subCategories.resultset[i].box;
	    }
	     document.getElementById('subcategorydiv').innerHTML=boxHtml;
	  
	}
     
      }
    }
  xmlHttp.send(null);  
 



}

function  showcategoryfields(catID){


//window.alert("sub"+catID);
document.getElementById('subcategory_error').innerHTML='';

var cityID=document.getElementById('cityidvalue').value;
//window.alert("Calling in city id is"+cityID);
// var catID=document.getElementById('category').value;
var catID=document.getElementById('catidvalue').value;
//window.alert("cat"+catID);
//window.alert("catidvalue"+document.getElementById('catidvalue').value);
var xmlHttp;
   try
      { 
       
       xmlHttp = new XMLHttpRequest();
       }
     catch (e)
      { 
        try
        {
        xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
         }
      
         catch (e)
         {   
            try
            {      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");  
             }
             catch (e)
                {     
                 return false;   
                }  
         } 
     }
 
  random = Math.random() * Date.parse(new Date()); 
 
  var url="./getcategoryfieldsjson?catID="+catID+"&cityID="+cityID+"&rand="+random;
 //window.alert(url);
   xmlHttp.open("GET", url , true );
   
   
   xmlHttp.onreadystatechange= function()
    {
    if(xmlHttp.readyState==4 && xmlHttp.status == 200)
      {
       
         var subCategories = eval( "(" +xmlHttp.responseText + ")" );   
	    var boxHtml="";
	    var paging="";
	   var len = subCategories.resultset.length;
	//    window.alert("len is:"+len);
	 if( len <= 0){
	 
	   document.getElementById('subcategorydiv').innerHTML="";
	   }else{
	   
	
	    for(var i=0;i<len;i++)
	    {
	     boxHtml+=subCategories.resultset[i].box;
	    }
	     document.getElementById('showcatfieldsdiv').innerHTML=boxHtml;
	  
	}
     
      }
    }
  xmlHttp.send(null);  




}
