function GetStates(Country)
{
    if(document.getElementById("loading_status")!= null){
		document.getElementById("loading_status").innerHTML = "<img src=images/progress-bar-dots.gif>";
	}
	if(window.XMLHttpRequest)
	{
		oRequest = new XMLHttpRequest();
	}
	else if(window.ActiveXObject)
	{
		oRequest = new ActiveXObject("Microsoft.XMLHTTP");
	}

	oRequest.open("POST", "GetStatelistPrayerTime.asp", true);
	oRequest.onreadystatechange = UpdateStateList;

	oRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	oRequest.send("strCountry=" + escape(Country));
}

function UpdateStateList()
{
	if(oRequest.readyState == 4)
	{
	if(oRequest.status == 200)
	{
		var States = oRequest.responseText;
		var stateBox = document.getElementById("State");

	               stateBox.options.length = 0;

	                if(States != "")
              	  {
                    		var arrStates = States.split(",");
                   	stateBox.options[stateBox.options.length] = new Option("Select a state");			
                   		 for(i = 0; i < arrStates.length; i=i+2)
                    		{
		                        if(arrStates[i] != "")
                        		          {
		                            stateBox.options[stateBox.options.length] = new Option(arrStates[i], arrStates[i+1]);

		                        }
                    		}
					}
		 if(document.getElementById("loading_status")!= null){
		document.getElementById("loading_status").innerHTML = "";
		 }
	}
	else
	{
		document.getElementById("Available").innerHTML = "Asychronous Error";
	}
	}
	//document.body.style.cursor = 'default';
}