// JavaScript Document
function createRequestObject()
{
	var xmlhttp = false;
	try
	{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e)
 	{
		try 
		{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  		} 
		catch (E) 
		{
			xmlhttp = false;
		}
 	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined')
	{
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function popup()
{
	//alert("aaaa");
	
/* Clearing the contents of the bookDetailsPanel DIV */
	document.getElementById('state').innerHTML = '';
	

/* Setting up an XMLHttpRequest */
    var request = createRequestObject();

/* Opening a request */
	request.open("GET", "dropdown1.php?st=state");
    
/* Defining an event handler.*/
	request.onreadystatechange = function() 
	{ 
		if(request.readyState==4) 
       	{	/* Holding the response received in a memory variable */
			var response = request.responseText;
		/* Populating the DIV with the response received */
			document.getElementById('state').innerHTML = response;
   		}
   	};
/* Sending the asynchronous request. */
	request.send(null);

}

function displayInfo(snm)
{
/* Clearing the contents of the bookDetailsPanel DIV */
	
	document.getElementById('city').innerHTML = '';

/* Setting up an XMLHttpRequest */
    var request = createRequestObject();

/* Opening a request */
	request.open("GET", "dropdown1.php?st=city&dt=" + snm);
    
/* Defining an event handler.*/
	request.onreadystatechange = function() 
	{ 
		if(request.readyState==4) 
       	{	/* Holding the response received in a memory variable */
			var response = request.responseText;
		/* Populating the DIV with the response received */
			document.getElementById('city').innerHTML = response;
   		}
   	};
/* Sending the asynchronous request. */
//document.getElementById('city').innerHTML = '';
//document.getElementById('district').innerHTML = '';

	request.send(null);

}

function displayInfo1(dnm)
{
/* Clearing the contents of the bookDetailsPanel DIV */
	
	document.getElementById('location').innerHTML = '';

/* Setting up an XMLHttpRequest */
    var request = createRequestObject();

/* Opening a request */
	request.open("GET", "dropdown1.php?st=location&dist=" + dnm);
    
/* Defining an event handler.*/
	request.onreadystatechange = function() 
	{ 
		if(request.readyState==4) 
       	{	/* Holding the response received in a memory variable */
			var response = request.responseText;
		/* Populating the DIV with the response received */
			document.getElementById('location').innerHTML = response;
   		}
   	};
/* Sending the asynchronous request. */
	request.send(null);

}
