
var xmlHttp

function exe_ajax(url, strHint)
{ 		
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
		alert ("Your browser does not support AJAX!");
		return;
	  } 

    xmlHttp.onreadystatechange=function()
	 {
	    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		   {	
			   if (xmlHttp.responseText!=1)
    		   	  document.getElementById(strHint).innerHTML=xmlHttp.responseText;
			   if (xmlHttp.responseText==1)	
				  location.href='http://www.barcelonabible.com/accommodation/done.php'; 
		   }
     };

	url=url+"&sid="+Math.random();
	//xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function exe_inquire(url)
{ 
	//alert(first);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
//	var url="js/registrar.php";
//	url=url+"?id="+id+"&first="+first+"&last="+last+"&phone="+phone+"&country="+country+"&email="+email+"&arrival="+arrival+"&departure="+departure+"&comment="+comment;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function showCitySelect(country,city)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="getcities.php";
	url=url+"?q="+country+"&r="+city;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged() 
{ 
	if (xmlHttp.readyState==4)	
	{ 	
		if (xmlHttp.responseText!=1)
			document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
		if (xmlHttp.responseText==1)	
			location.href='done.php';
	}
}


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;
}
