// JavaScript Document
	function objetus() {
			 try {
					 objeto = new ActiveXObject("Msxml2.XMLHTTP");
			} catch ( e) {
					 try {
							 objeto= new ActiveXObject (" Microsoft.XMLHTTP");
					 } catch (E) {
							  objeto= false;
					}
			}
			if (! objeto && typeof XMLHttpRequest!= 'undefined') {
					 objeto = new XMLHttpRequest();
			}
			return objeto;
	  }
	  
	  function suma_habitacion() {
	  
		var aleatorio=Math.random();
		if(document.getElementById('habitaciones').value<=10)
		{
			document.getElementById('habitaciones').value++;
		
		var hab_actual=document.getElementById('habitaciones').value; 
	  	var url = "numero_habitaciones.php?num="+hab_actual+"&";
		var params = "nocache="+aleatorio+"";
		


		var http = objetus();
		
		http.open("GET", url+"?"+params, true);
		
		//Send the proper header information along with the request
		http.setRequestHeader("Content-type", "text/html");
		//http.setRequestHeader("Content-length", params.length);
		//http.setRequestHeader("Connection", "close");
		
		http.onreadystatechange = function() {//Call a function when the state changes.
		if (http.readyState == 1) { // Cargando...
document.getElementById("loadingDiv").style.display = 'block';
}
			if(http.readyState == 4 && http.status == 200) {

				document.getElementById('campo_habitacion').innerHTML = http.responseText;
				document.getElementById("loadingDiv").style.display = 'none';
			}

		}
		http.send(null);
		} /* menor que 10 */
	  }

function resta_habitacion() {
	  
		var aleatorio=Math.random();
		if(document.getElementById('habitaciones').value>1)
		{
		   document.getElementById('habitaciones').value--;
				var hab_actual=document.getElementById('habitaciones').value; 
	  	var url = "numero_habitaciones.php?num="+hab_actual+"&";
		var params = "nocache="+aleatorio+"";
		


		var http = objetus();
		
		http.open("GET", url+"?"+params, true);
		
		//Send the proper header information along with the request
		http.setRequestHeader("Content-type", "text/html");
		//http.setRequestHeader("Content-length", params.length);
		//http.setRequestHeader("Connection", "close");
		
		http.onreadystatechange = function() {//Call a function when the state changes.
		if (http.readyState == 1) { // Cargando...
document.getElementById("loadingDiv").style.display = 'block';
}
			if(http.readyState == 4 && http.status == 200) {

				document.getElementById('campo_habitacion').innerHTML = http.responseText;
				document.getElementById("loadingDiv").style.display = 'none';
			}

		}
		http.send(null);
		}
}
function suma_habitacion_oferta(miform) {
	  
		var aleatorio=Math.random();
		
		var campoconcat = miform+"habitaciones_oferta";
		if(document.getElementById(campoconcat).value<=2)
		{
			document.getElementById(campoconcat).value++;
			
		
		var hab_actual=document.getElementById(campoconcat).value; 
	  	var url = "numero_habitaciones_oferta.php?num="+hab_actual+"&";
		var params = "nocache="+aleatorio+"";
		


		var http = objetus();
		
		http.open("GET", url+"?"+params, true);
		
		//Send the proper header information along with the request
		http.setRequestHeader("Content-type", "text/html");
		//http.setRequestHeader("Content-length", params.length);
		//http.setRequestHeader("Connection", "close");
		
		http.onreadystatechange = function() {//Call a function when the state changes.
		if (http.readyState == 1) { // Cargando...
document.getElementById("loadingDiv_oferta").style.display = 'block';
}
			if(http.readyState == 4 && http.status == 200) {

				document.getElementById(miform).innerHTML = http.responseText;
				document.getElementById("loadingDiv_oferta").style.display = 'none';
			}

		}
		http.send(null);
		} /* menor que 10 */
	  }

function resta_habitacion_oferta(miform) {
	  
		var aleatorio=Math.random();
		var campoconcat = miform+"habitaciones_oferta";
		if(document.getElementById(campoconcat).value>1)
		{
		   document.getElementById(campoconcat).value--;
				var hab_actual=document.getElementById(campoconcat).value; 
	  	var url = "numero_habitaciones_oferta.php?num="+hab_actual+"&";
		var params = "nocache="+aleatorio+"";
		


		var http = objetus();
		
		http.open("GET", url+"?"+params, true);
		
		//Send the proper header information along with the request
		http.setRequestHeader("Content-type", "text/html");
		//http.setRequestHeader("Content-length", params.length);
		//http.setRequestHeader("Connection", "close");
		
		http.onreadystatechange = function() {//Call a function when the state changes.
		if (http.readyState == 1) { // Cargando...
document.getElementById("loadingDiv_oferta").style.display = 'block';
}
			if(http.readyState == 4 && http.status == 200) {

				document.getElementById(miform).innerHTML = http.responseText;
				document.getElementById("loadingDiv_oferta").style.display = 'none';
			}

		}
		http.send(null);
		}
}
