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

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

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 valida_envia(){ 



    //valido el nombre 

    if (document.frmApartmento.cmbApartamento.value == "Ninguno")
		{ 
		   alert("Select a apartment"); 
		   document.frmApartmento.cmbApartamento.focus(); 
		   return 0; 
		}
    if (document.frmApartmento.txtDate.value.length != 10)
		{ 
		   alert("Insert a Date"); 
		   document.frmApartmento.txtDate.focus(); 
		   return 0; 
		}
	if (document.frmApartmento.txtDays.value.length ==0)
		{ 
		   alert("Insert the Days Acommodation"); 
		   document.frmApartmento.txtDays.focus(); 
		   return 0; 
		}
	if (document.frmApartmento.txtName.value.length ==0)
		{ 
		   alert("Insert a Name"); 
		   document.frmApartmento.txtName.focus(); 
		   return 0; 
		}
		
	if (document.frmApartmento.txtNum.value.length ==0)
		{ 
		   alert("Insert a people number"); 
		   document.frmApartmento.txtNum.focus(); 
		   return 0; 
		}
	if (document.frmApartmento.txtTel.value.length ==0)
		{ 
		   alert("Insert a phone number"); 
		   document.frmApartmento.txtTel.focus(); 
		   return 0; 
		}
	
		document.frmApartmento.submit();
	
	}
	
function valida_envia_2(){ 



	if (document.frmContactenos.txtNombres.value.length ==0)
		{ 
		   alert("Insert Your Name"); 
		   document.frmContactenos.txtNombres.focus(); 
		   return 0; 
		}
	if (document.frmContactenos.txtMail.value.length ==0)
		{ 
		   alert("Insert your Email"); 
		   document.frmContactenos.txtMail.focus(); 
		   return 0; 
		}
		
	
	
		document.frmContactenos.submit();
	
	}
function reservar(foto,nombre,precio)
	{	link1="detalle_departamento4_e.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);
	}
