var xmlHttp
var div_id
var div_id2

function get_salon(id)
{ 
xmlHttp=GetXmlHttpObject()
div_id=id
document.getElementById('salon').innerHTML="<center><img src='css/loading.gif'></center>";
if(xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
// alert(boton.value);
var url="salones_ajax.php" 
url=url+"?id="+ id
xmlHttp.onreadystatechange=state_changed_salon 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

//url=url+"&sid="+Math.random()
}

function get_room(id)
{ 
xmlHttp=GetXmlHttpObject()
div_id=id
document.getElementById('room').innerHTML="<center><img src='css/loading.gif'></center>";
if(xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
// alert(boton.value);
var url="habitaciones_ajax.php" 
url=url+"?id="+ id
xmlHttp.onreadystatechange=state_changed_room 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
//url=url+"&sid="+Math.random()
}


function get_contacto(nombre,apellido,domicilio,cp,pais,telefono,mail)
{ 
//alert(mail);
xmlHttp=GetXmlHttpObject()
div_id=id
document.getElementById('contacto').innerHTML="<center><img src='css/loading.gif'></center>";
if(xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
// alert(boton.value);
var url="do_contacto.php" 
url=url+"?nombre=" + nombre + "&apellido=" + apellido + "&domicilio=" + domicilio + "&cp=" + cp + "&pais=" + pais + "&telefono=" + telefono + "&mail=" + mail
xmlHttp.onreadystatechange=state_changed_contacto 
xmlHttp.open("POST",url,true)
xmlHttp.send(null)
url=url+"&sid="+Math.random()
}



function get_restaurant(id)
{ 
xmlHttp=GetXmlHttpObject()
div_id=id
document.getElementById('restaurant').innerHTML="<center><img src='css/loading.gif'></center>";
if(xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
// alert(boton.value);
var url="restaurantes_ajax.php" 
url=url+"?id="+ id
xmlHttp.onreadystatechange=state_changed_restaurant 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
//url=url+"&sid="+Math.random()
}

function get_golf(id)
{ 
xmlHttp=GetXmlHttpObject()
div_id=id
document.getElementById('golf').innerHTML="<center><img src='css/loading.gif'></center>";
if(xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
// alert(boton.value);
var url="golf_ajax.php" 
url=url+"?id="+ id
xmlHttp.onreadystatechange=state_changed_golf 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
//url=url+"&sid="+Math.random()
}

function get_club(id)
{ 
xmlHttp=GetXmlHttpObject()
div_id=id
document.getElementById('club').innerHTML="<center><img src='css/loading.gif'></center>";
if(xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
// alert(boton.value);
var url="club_ajax.php" 
url=url+"?id="+ id
xmlHttp.onreadystatechange=state_changed_club 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
//url=url+"&sid="+Math.random()
}


function get_relax(id)
{ 
xmlHttp=GetXmlHttpObject()
div_id=id
document.getElementById('relax').innerHTML="<center><img src='css/loading.gif'></center>";
if(xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
// alert(boton.value);
var url="relax_ajax.php" 
url=url+"?id="+ id
xmlHttp.onreadystatechange=state_changed_relax 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
//url=url+"&sid="+Math.random()
}


function get_promo(id)
{ 
xmlHttp=GetXmlHttpObject()
div_id=id
document.getElementById('promo').innerHTML="<center><img src='css/loading.gif'></center>";
if(xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
// alert(boton.value);
var url="promociones_ajax.php" 
url=url+"?id="+ id
xmlHttp.onreadystatechange=state_changed_promo 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
//url=url+"&sid="+Math.random()
}


function state_changed_salon() 
{ 

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById('salon').innerHTML=xmlHttp.responseText 
// initLightbox();

 } 
 
 /*
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		document.getElementById('salon').innerHTML=xmlHttp.responseText;
		if (typeof Slimbox.updateElementList === 'function'){
			myLightbox.updateElementList();
		}
	}*/
 
 
}

function state_changed_room() 
{ 
//alert(div_id);
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById('room').innerHTML=xmlHttp.responseText 
// alert(xmlHttp.responseText )
 } 
}



function state_changed_contacto() 
{ 
alert('state_changed');
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById('contacto').innerHTML=xmlHttp.responseText 
// alert(xmlHttp.responseText )
 } 
}



function state_changed_promo() 
{ 
//alert(div_id);
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById('promo').innerHTML=xmlHttp.responseText 
// alert(xmlHttp.responseText )
 } 
}

function state_changed_restaurant() 
{ 
//alert(div_id);
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById('restaurant').innerHTML=xmlHttp.responseText 
// alert(xmlHttp.responseText )
 } 
}
function state_changed_golf() 
{ 
//alert(div_id);
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById('golf').innerHTML=xmlHttp.responseText 
// alert(xmlHttp.responseText )
 } 
}

function state_changed_club() 
{ 
//alert(div_id);
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById('club').innerHTML=xmlHttp.responseText 
// alert(xmlHttp.responseText )
 } 
}


function state_changed_relax() 
{ 
//alert(div_id);
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById('relax').innerHTML=xmlHttp.responseText 
// alert(xmlHttp.responseText )
 } 
}

function stateChanged3() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById('la_codes' + div_id2).innerHTML=xmlHttp.responseText 
// alert(xmlHttp.responseText )
 } 
}

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;
}
