var xmlHttp
var cid1;
var cid3;
var val3;
function Check_Departure(val1,id1,val2,id2,passwd)
{ 
cid1=id1;
cid3=id2;
val3=val2;
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}


if (passwd!="2803")

{

alert ("The site now requires a password in order to drop a request. We will return to a fully open and automatic version of the service in 2008.")

return

}
var url="search_city.php?val="+val1;
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 

if (xmlHttp.readyState==4)
{ 
var msg1=xmlHttp.responseText;
if(msg1!="")
{
 if(msg1=="m")
 { 
  alert("Either incorrect Departure or Departure not available! ");
  document.getElementById(cid1).focus();
 }
 else
 {
   document.getElementById(cid1).value=msg1;
   Check_Destination(val3,cid3);
 } 
}
else
{
  Check_Destination(val3,cid3);
}
}
}



//###########################################################################
var xmlHttp
var cid2;
function Check_Destination(val,id)
{ 
cid2=id;

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="search_city.php?val="+val;
xmlHttp.onreadystatechange=stateChanged1 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged1() 
{ 

if (xmlHttp.readyState==4)
{ 
var msg2=xmlHttp.responseText;
if(msg2!="")
{
 if(msg2=="m")
 {
  alert("Either incorrect Destination or Destination not available! ");
  document.getElementById(cid2).focus();
 }
 else
 {
   document.getElementById(cid2).value=msg2;
   checkform();
 } 
}
else
{
  checkform();
}
}
}


function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}