function xmlhttp()
{ 
	var xmlhttp=false;
	try
	{
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(E)
		{
			if (!xmlhttp && typeof XMLHttpRequest!='undefined') xmlhttp=new XMLHttpRequest();
		}
	}
	return xmlhttp; 
}

function pageHotels(pagina){
	var Obj =  xmlhttp();
	Obj.open("GET", "resultsAjax.php?pagina="+pagina, true);
	Obj.onreadystatechange=function() { 
		if (Obj.readyState==1){
			
			document.getElementById("loaderPanel").style.display = "block";
			var x=1;
		}
		if (Obj.readyState==4){				
			document.getElementById("resultItems").innerHTML = Obj.responseText;
			document.getElementById("loaderPanel").style.display = "none";
		} 
	}
	Obj.send(null);
}

function changeCountry(idCountry){
	var dCode = document.getElementById('dCode');
	var Obj =  xmlhttp();
	//Obj.open("GET", "http://servidor/viajarexotico/selectData.php?idCountry="+idCountry, true);
	Obj.open("GET", "http://www.viajarexotico.com/selectData.php?idCountry="+idCountry, true);
	Obj.onreadystatechange=function() { 
		if (Obj.readyState==1){
	       dCode.length=0;
		   dCode.style.color='#FF0000';
		   dCode.options[0]=new Option('Buscando...','0');
		}
		if (Obj.readyState==4){	
			dCode.style.color='#000000';
			var xmlDestinations = Obj.responseXML.documentElement;
			dCode.length=xmlDestinations.childNodes.length;
			for(i=0; i<xmlDestinations.childNodes.length; i++){
				dDescription = unescape(xmlDestinations.childNodes[i].childNodes[1].firstChild.nodeValue).replace(/\+/gi," ");
				dId = xmlDestinations.childNodes[i].childNodes[0].firstChild.nodeValue;
				dCode.options[i]=	new Option(dDescription,dId);
			}
		   
		} 
	}
	Obj.send(null);
}