// JavaScript Document

// The server-side script
  /*var http = getHTTPObject();
  function getHTTPObject()
	{
	  
		 var objxmlhttp=false;
		if(window.XMLHttpRequest && !(window.ActiveXObject)) 
		{
    		try {
				objxmlhttp = new XMLHttpRequest();
        	} 
        	catch(e) 
        	{
				objxmlhttp = false;
        	}
    	}
     	else if(window.ActiveXObject)
     	{
       		try 
       		{
        		objxmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
				alert("gaurang")
      		} 
      		catch(e) 
      		{
        		try 
        		{
          			objxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        		} 
        		catch(e) 
        		{
          			objxmlhttp = false;
        		}
			}
     	}
		return objxmlhttp;
	}
	 
	   function handleHttpResponse() 
	   {   
	   		if (http.readyState == 4) {
				  if(http.status==200) {
					  var results=http.responseText;
					  
				  document.getElementById('divStateInfo').innerHTML = results;
				  }
				  }
        }
       
        function requestCountryInfo() 
		{     
			var url = "GetCountryData.php?id="; 
            var sId = document.getElementById("CountryId").value;
			
			http.open("GET", url + escape(sId), true);
            http.onreadystatechange = handleHttpResponse;
            http.send(null);
        }

*/
//--------------------------------------------------------------------------------


/* 
*/

/*// will store the reference to the XMLHttpRequest object
var xmlHttp;
// if running Internet Explorer
if(window.ActiveXObject)
{
	alert('IE');
	try{xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");}
	catch (e){xmlHttp = false;}
}
// if running Mozilla or other browsers
else
{
	alert('mozila');
	try{xmlHttp = new XMLHttpRequest();}
	catch (e){xmlHttp = false;}
}
// return the created object or display an error message
if (!xmlHttp)
alert("Error creating the XMLHttpRequest object.");
else
return xmlHttp;*/



         // The server-side script
       function handleHttpResponse() {   
        if (http.readyState == 4) {
              if(http.status==200) {
                  var results=http.responseText;
	              document.getElementById('divStateInfo').innerHTML = results;			 
              }
              }
        }
       
	    function handleHttpResponse1() {   
        if (http.readyState == 4) {
              if(http.status==200) {
                  var results=http.responseText;
					document.getElementById('divsubcategoryInfo').innerHTML = results;			 
              }
              }
        }
	   
        function requestCountryInfo() {  
            var url = "GetCountryData.php?id=";			
			var sId = document.getElementById("CountryId").value;
            http.open("GET", url + escape(sId), true);
            http.onreadystatechange = handleHttpResponse;
            http.send(null);
        }
		
		function requestCategoryInfo() {  
            var url = "GetCategoryData.php?id=";
			var sId = document.getElementById("CategoryId").value;
			http.open("GET", url + escape(sId), true);
            http.onreadystatechange = handleHttpResponse1;
            http.send(null);
        }
function getHTTPObject() 
{
  var xmlhttp;

  if(window.XMLHttpRequest)
  {
    xmlhttp = new XMLHttpRequest();
  }
  else if (window.ActiveXObject)
  {
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    
	if (!xmlhttp)
	{
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
  
  }
  return xmlhttp;
}
  var http = getHTTPObject();