function show_city(sText)
{
	var ajaxRequest;  // The variable that makes Ajax possible!
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e){
				// Something went wrong
				alert("Your browser is not compitable for the page on which you are working!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function()
	{
		if(ajaxRequest.readyState == 4)
		{
		  var restest=ajaxRequest.responseText;
		  var s=restest.split("--");
		 //alert(restest);
		  var len=s.length;
		  var i=0;
		  removeAllOptions(document.acc_frm.city);
		  addOption(document.acc_frm.city, "", "----Select City----", "");
			  while(i<len-1)
			  {
			  var pid=s[i++];
			  addOption(document.acc_frm.city, pid, pid);
			  }
	   }
	   document.acc_frm.city.focus();
	}
    //document.acc_frm.locality.focus();
	
    var state = document.acc_frm.state.value;
	var queryString = "?state=" + state;
	//alert(queryString);
	ajaxRequest.open("GET", "dealertime.php" + queryString, true);
	ajaxRequest.send(null); 
}
function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}
function addOption(selectbox, value, text )
{
	var optn = document.createElement("Option");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}

