var xmlHttp
function callAjax(url,str,whichID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var getUrl=url
url=url+"?q="+str
url=url+"&sid="+Math.random()
xmlHttp.open("GET",url,true)
xmlHttp.onreadystatechange=function stateChanged() {
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById(whichID).innerHTML=xmlHttp.responseText;
 if (getUrl=="/getAirportPick.php") {
 var result1=xmlHttp.responseText.split("<br>");
 document.getElementById('pick_add1').value=result1[1];
 document.getElementById('pick_city').value=result1[2].replace(/<([^>]+)>/g,'');
 document.getElementById('pick_postcode').value=result1[3];
 document.getElementById('ap_pick').value=1;
 document.getElementById('st_pick').value=0;
} 
 if (getUrl=="/getAirportDest.php") {
 var result1=xmlHttp.responseText.split("<br>");
 document.getElementById('dest_add1').value=result1[1];
 document.getElementById('dest_city').value=result1[2].replace(/<([^>]+)>/g,'');
 document.getElementById('dest_postcode').value=result1[3];
 document.getElementById('ap_dest').value=1;
 document.getElementById('st_dest').value=0;
 } 
 }
}
xmlHttp.send(null)
}
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;
}