var xmlHttpSub,dispId;
function populateState(value)
{
	xmlHttpSub=GetXmlHttpObjectSub();
	//dispId = id;
	if (xmlHttpSub==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}//if (xmlHttp==null)
	var url="populateState.php?val=" + value + "&sid=" + Math.random();
	xmlHttpSub.onreadystatechange=stateChangedState ;
	xmlHttpSub.open("GET",url,true);
	xmlHttpSub.send(null);
}//function chkEmailDetails(value)

function populateCity()
{
	//alert(document.getElementById('s1').value);
	var value = document.forms[0].state.value;
	xmlHttpSub=GetXmlHttpObjectSub();
	//dispId = id;
	if (xmlHttpSub==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}//if (xmlHttp==null)
	var url="populateCity.php?val=" + value + "&sid=" + Math.random();
	xmlHttpSub.onreadystatechange=stateChangedCity ;
	xmlHttpSub.open("GET",url,true);
	xmlHttpSub.send(null);
}//function populateCity(value)

function stateChangedState() 
{
	if(xmlHttpSub.readyState==4)
	{
		//alert(xmlHttpSub.responseText);
		document.getElementById('idState').innerHTML = xmlHttpSub.responseText;
		document.getElementById('idCity').innerHTML = "<select name='city' size='1'> <option selected value=''>[Select]</option></select>";
	}//if(xmlHttp.readyState==4)
}//function stateChanged() 

function stateChangedCity() 
{
	if(xmlHttpSub.readyState==4)
	{
		//alert(xmlHttpSub.responseText);
		document.getElementById('idCity').innerHTML = xmlHttpSub.responseText;
		
	}//if(xmlHttp.readyState==4)
}//function stateChangedCity() 

function GetXmlHttpObjectSub()
{
	var objXMLHttp=null;
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest();
	}//if (window.XMLHttpRequest)
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}//else if (window.ActiveXObject)
	return objXMLHttp;
}//function GetXmlHttpObject()

