var xmlHttp;

//Will attempt to crate XMLHttpRequest object if the browser supports it.
function verifyBrowser()
{  
	try
	{ 
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();    
	}
	catch (e)
	{    
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); 
			}
			catch (e)
			{        
				alert("Your browser does not support AJAX!");        
				return false;        
			}     
		}    
	} 
}

//Will get us the the desired airports for the specified country
function getAirportsForThisCountry(Country)
{
	verifyBrowser();
	
	xmlHttp.onreadystatechange=function()
    {
    	if(xmlHttp.readyState==4)
        {
			var response = xmlHttp.responseText;
			document.getElementById("dest").innerHTML = response;
        }
    }
	
	var url="getAirportsByCountry.php";
	url=url+"?Country="+Country;
	
	xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
}
