function switchLink(alink, blink, cell){

document.getElementById(alink).style.display = 'inline';
document.getElementById(blink).style.display = 'none';

	if (document.getElementById(cell).style.display == 'none')
		document.getElementById(cell).style.display = 'block';

	else document.getElementById(cell).style.display = 'none';


}

function GetXmlHttpObject(handler)  
{  
   var objXMLHttp=null  
   if (window.XMLHttpRequest)  
   {  
       objXMLHttp=new XMLHttpRequest()  
   }  
   else if (window.ActiveXObject)  
   {  
       objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")  
   }  
   return objXMLHttp  
}  
  
function stateChanged()  
{  
   if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")  
   {  
           document.getElementById("txtResult").innerHTML= xmlHttp.responseText;  
   }  
   else {  
           //alert(xmlHttp.status);  
   }  
}  
  
// Will populate data based on input  
function htmlData(url, qStr)  
{  
   if (url.length==0)  
   {  
       document.getElementById("txtResult").innerHTML="";  
       return;  
   }  
   xmlHttp=GetXmlHttpObject()  
   if (xmlHttp==null)  
   {  
       alert ("Browser does not support HTTP Request");  
       return;  
   }  
  
   url=url+"?"+qStr;  
   url=url+"&sid="+Math.random();  
   xmlHttp.onreadystatechange=stateChanged;  
   xmlHttp.open("GET",url,true) ;  
   xmlHttp.send(null);  
}  

function submitSearch(){
	
    	var new_action = document.getElementById('search').action;
    	var country = document.getElementById('search').country.value;
    	var city = document.getElementById('search').city.value;
    	
    	if(country != '') new_action = new_action + '/' + country;
    	if(city != '') new_action = new_action + '/' + city;
    	
    	document.getElementById('search').action = new_action;
    	document.getElementById('search').country.disabled = true;
    	document.getElementById('search').city.disabled = true;
    	document.getElementById('search').submit();
    
}
