var xmlHttp
function showCounty(country,state)
{  
   
	//alert(country);
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	} 
	var url="show_county.php"
	url=url+"?countryName="+country+"&state="+state+"&state_id=1";
	
	xmlHttp.onreadystatechange=countyChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 


function showCounty1(country1,state1)
{
	//alert(""+jQuery("#"+state1));
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="show_county.php"
url=url+"?countryName="+country1+"&state="+state1+"&state_id=2";
xmlHttp.onreadystatechange=countyChanged1 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function showCounty2(country2,state2)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="show_county.php"
url=url+"?countryName="+country2+"&state="+state2+"&state_id=3";
xmlHttp.onreadystatechange=countyChanged2 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function showCounty3(country3,state3)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="show_county.php"
url=url+"?countryName="+country3+"&state="+state3+"&state_id=4";
xmlHttp.onreadystatechange=countyChanged3 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function showCounty_training(country,state,countyID)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="show_county_training.php"
url=url+"?countryName="+country+"&state="+state+"&countyID="+countyID
xmlHttp.onreadystatechange=countyChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 
function showCounty_event(country,state)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 


	var url="show_county_event.php"
	url=url+"?countryName="+country+"&state="+state
	xmlHttp.onreadystatechange=countyChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 



function showBranchCountry(bcountry,state){
//alert(state);
 xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
	 alert ("Browser does not support HTTP Request")
	 return
	} 
	
	var url="show_branch_county.php"
	url=url+"?countryName="+bcountry+"&state="+state+"&bstate_id=1";
	alert(url);
	
	xmlHttp.onreadystatechange=countyChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	
}

function branchcountyChanged(){
	document.getElementById("show_branchcounty_dropdown").innerHTML=xmlHttp.responseText 
}


function countyChanged() 
{ 
		
		document.getElementById("show_county_dropdown").innerHTML=xmlHttp.responseText 
} 
function countyChanged1() 
{ 
		document.getElementById("show_county_dropdown1").innerHTML=xmlHttp.responseText 
}		
function countyChanged2() 
{ 
		document.getElementById("show_county_dropdown2").innerHTML=xmlHttp.responseText 
}		
function countyChanged3() 
{ 
		document.getElementById("show_county_dropdown3").innerHTML=xmlHttp.responseText 
}		

function GetXmlHttpObject()
{
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	//alert(browser);
	if(browser == "Microsoft Internet Explorer")
	{
		/* Create the object using MSIE's method */
		
		try 
		{
			request_o = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
		}
		catch (e) 
		{
			try
			{
				request_o = new ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
			}
			catch (E) 
			{
				request_o = false;
			}
		}
		
		//request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else
	{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}
