function flash(swf, ancho, alto){
	var sTag=''
		+ ' <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + ancho + '" height="' + alto + '">'
		+ '  <param name="movie" value="' + swf + '">'
		+ '  <param name="quality" value="high">'
		+ '  <param name="menu" value="false">'
		+ '  <param name="wmode" value="transparent">'
		+ '  <embed src="' + swf + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + ancho + '" height="' + alto + '"></embed>'
		+ '</object>'
		+ '';
	document.write (sTag);
}

function ampliar(photo){
window.open('zoom.php?pht='+photo,'ampliar','menubar=no, scrollbars=no, width=50, height=50, directories=no,location=no,resizable=no,status=no,toolbar=no')
}

function ira(donde){
	window.location.href=donde;
}

function inicisesion(){
    alert("Para proceder a reservar primero debe iniciar sesión.");
	document.location="#lg";
	document.getElementById('lgiUsr').focus();
	return false;
}
function divisiones(id){
	if(document.getElementById(id).style.display == 'none')
	  document.getElementById(id).style.display = 'block';
	else
	  document.getElementById(id).style.display = 'none';
}

function listarprop(prp,pg){
	dir="inc/lstprop.php?prp="+prp+"&pg="+pg;
	document.getElementById("prop").innerHTML="<br><br><br><br><img src='imgs/loading.gif'><br>Cargando... por favor espere";
	new Ajax.Updater("prop", dir)
}

function sesioncontrato(){
	alert("Para contratar primero debe inciar sesión");
	document.location="#lg";
	document.getElementById('lgiUsr').focus();
}

function muestracalendario(id){
 	mes=document.getElementById("mes").value;
	anio=document.getElementById("anio").value;
	dir="inc/muestracalendarios.php?id="+id+"&mes="+mes+"&anio="+anio;
	document.getElementById("divcalendarios").innerHTML="<center><br><br><img src='imgs/loading1.gif' width='30'><br><br>Cargando... por favor espere<br><br></center>";
	new Ajax.Updater("divcalendarios", dir)
}

function verificadisponibilidad(id){
    msg="";
	ingresa=document.getElementById("ingresa").value;
	sale=document.getElementById("sale").value;
	dir="inc/verifydisp.php?id="+id+"&ing="+ingresa+"&sal="+sale;
	document.getElementById("divconf").innerHTML="<center><br><img src='imgs/loading2.gif' width='30'><br><br><i>Verificando disponibilidad<br>por favor espere...</i><br></center>";
    new Ajax.Updater("divconf", dir)
}

function confirmarreservacasa(id){
	ingresa=document.getElementById("ingresa").value;
	sale=document.getElementById("sale").value;
	dir="inc/generareserva.php?id="+id+"&ing="+ingresa+"&sal="+sale;
	document.getElementById("divconf").innerHTML="<center><br><img src='imgs/loading2.gif' width='30'><br><br><i>Generando su pedido<br>por favor espere...</i><br></center>";
    new Ajax.Updater("divconf", dir)
}
function verhabitaciones(id){
	llegada=document.getElementById("llegada").value;
	salida=document.getElementById("salida").value;
	adultos=document.getElementById("adultos").value;
	ninios=document.getElementById("ninios").value;
	dir="inc/buscahab.php?id="+id+"&ing="+llegada+"&sal="+salida+"&adult="+adultos+"&ninios="+ninios;
	document.getElementById("resulthab").innerHTML="<center><br><br><img src='imgs/loading2.gif' width='30'><br><br>Buscando... por favor espere<br><br></center>";
	new Ajax.Updater("resulthab", dir)
}
function formubuscar(id){
	dir="inc/frmbusquedas.php?frm="+id;
    new Ajax.Updater("formulario", dir)
}
