function createRequestObject(){
	var xmlHttp;
	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();

	}catch (e)	{
		// Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e)	{
			try{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}catch (e)	{
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}

	return xmlHttp;

}//createRequestObject


function handleDivTag(divtag)
{
   var divtag;
   return divtag;
}


// Make the XMLHttpRequest object
var http = createRequestObject();


// Create the Divtag Handler -- Mainly an IE 6 Fix
var divhandler = new handleDivTag(null); 


function sendRequest(val,divId) {
	// This function is getting used in registration process

   // Open PHP script for requests
   
   url="retrieveStateList.php?countryId="+val;
   http.open('get',url);
   http.onreadystatechange = handleResponse;
   divhandler.divtag = divId;
   http.send(null);

}//sendRequest


function handleResponse() {

   if(http.readyState == 4 && http.status == 200){

      // Text returned FROM the PHP script
      var response = http.responseText;
	
      if(response) {
         // UPDATE ajaxTest content
         document.getElementById(divhandler.divtag).innerHTML = response;
      }

   }
  
}//handleResponse