var xmlHttp1; 
	xmlHttp1=GetxmlHttpObject();
if (xmlHttp1==null)
  {
  alert ("Your browser does not support AJAX!");
  //return;
  } 
  
function getState1(url)
{ 
	//if(xmlHttp1 != null) 
	xmlHttp1=GetxmlHttpObject();
	document.getElementById("divCity1").innerHTML='';
	document.getElementById("divState1").innerHTML='<font color=red>Please wait...</font>';
	
	/*if(url == 'getstate_freecomp1.php?country=INDIA')
	{
		document.getElementById("divState1").innerHTML = indiaStates;
	}
	else
	{*/
		xmlHttp1.onreadystatechange=stateChanged_1;
		xmlHttp1.open("GET",url,true);
		xmlHttp1.send(null);
	//}
} 
function getCity1(url)
{ 
	xmlHttp1=GetxmlHttpObject();
	xmlHttp1.onreadystatechange=stateChanged_2;
	xmlHttp1.open("GET",url,true);
	xmlHttp1.send(null);
	
} 


function stateChanged_1() 
{ 
if (xmlHttp1.readyState==4)
	{ 
			document.getElementById("divCity1").innerHTML='';
			document.getElementById("divState1").innerHTML=xmlHttp1.responseText;
	}
}

function stateChanged_2() 
{ 
if (xmlHttp1.readyState==4)
	{ 
		document.getElementById("divCity1").innerHTML=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 setCity1(val){
	if(val == 'Not in List'){
		document.f.found1.value = 'R';
		document.f.birthplace_city1.value = '';
	}
	else{
		document.f.found1.value = 'H';
		document.f.birthplace_city1.value = val;
	}
	
}
function setCountry1(val){
	document.f.birthplace_country1.value = document.f.country1.value;
	document.f.birthplace_city1.value = '';
	cIndex = val.indexOf('- U.S.A.');
	if(cIndex > 0)
		document.f.birthplace_state1.value = val.substring(0,cIndex - 1)
	else
		document.f.birthplace_state1.value = '';
}

