var xmlHttp1; 
	xmlHttp1=GetxmlHttpObject();
if (xmlHttp1==null)
  {
  alert ("Your browser does not support AJAX!");
  //return;
  } 
  
function getState(url)
{ 
	//if(xmlHttp1 != null) 
	xmlHttp1=GetxmlHttpObject();
	document.getElementById("divCity").innerHTML='';
	document.getElementById("divState").innerHTML='<font color=red>Please wait...</font>';
	
	if(url == 'getstate.php?country=INDIA')
	{
		document.getElementById("divState").innerHTML = indiaStates;
	}
	else
	{
		xmlHttp1.onreadystatechange=stateChanged;
		xmlHttp1.open("GET",url,true);
		xmlHttp1.send(null);
	}
} 
function getCity(url)
{ 
	xmlHttp1=GetxmlHttpObject();
	xmlHttp1.onreadystatechange=stateChanged1;
	xmlHttp1.open("GET",url,true);
	xmlHttp1.send(null);
	
} 

function getMoonSign(url)
{ 
	xmlHttp1=GetxmlHttpObject();
	xmlHttp1.onreadystatechange=stateChanged2;
	xmlHttp1.open("GET",url,true);
	xmlHttp1.send(null);
	
} 


function stateChanged() 
{ 
if (xmlHttp1.readyState==4)
	{ 
			document.getElementById("divCity").innerHTML='';
			document.getElementById("divState").innerHTML=xmlHttp1.responseText;
	}
}

function loadState(){
	
}

function stateChanged1() 
{ 
if (xmlHttp1.readyState==4)
	{ 
		document.getElementById("divCity").innerHTML=xmlHttp1.responseText;
	}
}

function stateChanged2() 
{ 
if (xmlHttp1.readyState==4)
	{ 
		document.birth.msign.value=xmlHttp1.responseText;
	}
}


function GetxmlHttpObject()
{ 
var xmlHttp=null;
try
  { 
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest(); 
  }
catch (e)
  {
  // Internet Explorer
  try
    { 
    xmlHttp=new ActiveXObject("Msxml2.XMLHttp");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHttp");
    }
  } 
return xmlHttp;
}

function setCity(val){
	if(val == 'Not in List'){
		document.birth.found.value = 'R';
		document.birth.birthplace_city.value = '';
	}
	else{
		document.birth.found.value = 'H';
		document.birth.birthplace_city.value = val;
	}
	
	/*country = document.birth.country.value;
	cIndex = country.indexOf('- U.S.A.');
	if(cIndex > 0)
		document.birth.birthplace_state.value = country.substring(0,cIndex - 1)
	else
		document.birth.birthplace_state.value = '';*/
}
function setCountry(val){
	document.birth.birthplace_country1.value = document.birth.country.value;
	document.birth.birthplace_city.value = '';
	cIndex = val.indexOf('- U.S.A.');
	if(cIndex > 0)
		document.birth.birthplace_state.value = val.substring(0,cIndex - 1)
	else
		document.birth.birthplace_state.value = '';
}

