/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

    var _place_selection = null;
    function GetXmlHttpObject(handler)  
    {  
       var objXMLHttp=null  
       if (window.XMLHttpRequest)  
       {  
           objXMLHttp=new XMLHttpRequest()  
       }  
       else if (window.ActiveXObject)  
       {  
          objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")  
      }  
      return objXMLHttp  
   }  
     
   function catChanged()  
   {    
      if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")  
      {  
            

              if(_place_selection=='sub_cat'){
            	  if(document.getElementById("txtResultSubCat")!=null)
                document.getElementById("txtResultSubCat").innerHTML= xmlHttp.responseText; 
            	  if(document.getElementById("txtResultSubCatLable")!=null)
                document.getElementById("txtResultSubCatLable").innerHTML= "Sub Category:"; 
             
              }                
             
      }  
     
   }  
     
   // Will populate data based on input  
   function htmlDataCat(url,name,place_selection,selected)  
   {     
	   
	   var cat_id=document.getElementById(name).value;  
	   
	   var select=null;
	   
	   if(document.getElementById(selected)!=null)
		   select=document.getElementById(selected).value; 
      _place_selection = place_selection;
      
      if (url.length==0)  
      {           
          return;  
      }  
      xmlHttp=GetXmlHttpObject();  
      if (xmlHttp==null)  
      {  
          alert ("Browser does not support HTTP Request");  
          return;  
      }  
    
         if(select==null)
         url = url+"&id="+cat_id; 
         else
         url = url+"&id="+cat_id+"&selected="+select; 	 	
      
      // alert("url:"+url);
      
      xmlHttp.onreadystatechange=catChanged;  
      xmlHttp.open("GET",url,true) ;  
      xmlHttp.send(null);  
   }  
   
   
   
  
   
  
   
   
  
     
   



