function objetoAjax(){
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
  		}
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function AJAXCrearObjeto_verificar_url(){ 
 var obj; 
 if(window.XMLHttpRequest) { // no es IE o IE7
 obj = new XMLHttpRequest(); 
 } else { // Es IE o no tiene el objeto 
 try { 
 obj = new ActiveXObject("Microsoft.XMLHTTP"); 
 } 
 catch (e) { 
 alert('El navegador utilizado no está soportado'); 
 } 
 } 
 return obj; 
} 

function ver_noches(url, fecha_llegada, fecha_salida)
{
	divResultado1 = document.getElementById('vnoches');
	ajax1=objetoAjax();
	ajax1.open("GET", url+'scripts/ajax/ajax_nro_noches.php?fecha_llegada='+fecha_llegada+'&fecha_salida='+fecha_salida);
	ajax1.onreadystatechange=function() {
		if (ajax1.readyState==4) {
			divResultado1.innerHTML = ajax1.responseText;
		}
	}
	ajax1.send(null);
}

function ver_tipo_habitacion(url, id)
{
	divResultado3 = document.getElementById('vhabitacion');
	ajax3=objetoAjax();
	ajax3.open("GET", url+'scripts/ajax/ajax_tipo_habitacion.php?id='+id);
	ajax3.onreadystatechange=function() {
		if (ajax3.readyState==4) {
			divResultado3.innerHTML = ajax3.responseText;
		}
	}
	ajax3.send(null);
}
function ver_inicio(url, id, fecha_llegada, fecha_salida)
{
	ver_noches(url, fecha_llegada, fecha_salida);
	ver_tipo_habitacion(url, id);
}