// JavaScript Document
function ver_foto(foto)
	{	link1="detalle_departamento.php?id_departamento="+foto
		var opciones="left=100,top=100,width=1050,height=520,border=0", i= 0;
		 window.open(link1,"",opciones);
	}

function ocultar()
	{	
	document.getElementById("Layer1").style.visibility = "hidden";
//	alert("prueba");
	}

function reservar(foto,nombre,precio)
	{	link1="detalle_departamento4.php?id_departamento="+foto+"&nombre="+nombre+"&precio="+precio
		var opciones="left=100,top=100,width=1050,height=520,border=0", i= 0;
		 window.open(link1,"",opciones);
	}


function val(e) {
    tecla = (document.all) ? e.keyCode : e.which;
    if (tecla==8) return true;
    patron =/^[0-9]*[0-9]+$|^[0-9]+[0-9]*$/;
    te = String.fromCharCode(tecla);
    return patron.test(te);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='index.php?id="+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function valida_envia(){ 



    //valido el nombre 
	
	  if (document.frmApartmento.cmbApartamento.value == "Ninguno")
		{ 
		   alert("Selecione un Apartamento");
		   document.frmApartmento.cmbApartamento.focus();
		   return 0; 
		}

    if (document.frmApartmento.txtDate.value.length != 10)
		{ 
		   alert("Ingrese una fecha de reserva");
		   document.frmApartmento.txtDate.focus();
		   return 0; 
		}
	if (document.frmApartmento.txtDays.value.length ==0)
		{ 
		   alert("Ingrese la cantidad de dias"); 
		   document.frmApartmento.txtDays.focus(); 
		   return 0; 
		}
	if (document.frmApartmento.txtName.value.length ==0)
		{ 
		   alert("Ingrese un nombre"); 
		   document.frmApartmento.txtName.focus(); 
		   return 0; 
		}
		
	if (document.frmApartmento.txtNum.value.length ==0)
		{ 
		   alert("Ingrese el numero de personas"); 
		   document.frmApartmento.txtNum.focus(); 
		   return 0; 
		}
	if (document.frmApartmento.txtTel.value.length ==0)
		{ 
		   alert("Ingrese un número de teléfono de referencia"); 
		   document.frmApartmento.txtTel.focus(); 
		   return 0; 
		}
	
		document.frmApartmento.submit();
	
	}
	
function gracias()
	{	alert("Gracias por votar!");
	}

function valida_envia_2(){ 



	if (document.frmContactenos.txtNombres.value.length ==0)
		{ 
		   alert("Ingrese su nombre");
		   document.frmContactenos.txtNombres.focus();
		   return 0; 
		}
	if (document.frmContactenos.txtMail.value.length ==0)
		{ 
		   alert("Ingrese su Email"); 
		   document.frmContactenos.txtMail.focus();
		   return 0; 
		}
		
	
	
		document.frmContactenos.submit();
	
	}