// JavaScript Document
function chequea(este) {
if (este.nombre.value =="") {
           alert("Escriba su nombre");
		   este.nombre.focus();
		   return (false);
                                  }

if (este.email.value.indexOf('@', 0) == -1 || este.email.value.indexOf('.', 0) == -1)  { 
                alert("Dirección de e-mail inválida"); 
				este.email.focus(); 
				return(false); 
				                }


 if (este.nombre.value =="") {
           alert("Escriba su nombre");
		   reserva.nombre.focus();
		   return (false);
                                  }


};


// ----------------------------------------------------


// Para el formulario de inscribir casa.

function validarEmail(cadena) {
var filter=/^[A-Za-z][A-Za-z0-9_.]*@[A-Za-z0-9_]+.[A-Za-z0-9_.]+[A-za-z]$/;
if (cadena.length == 0 ) 
return (true);
if (filter.test(cadena))
return (true);
else
return (false);
};





function validar(reserva) {
  // Chequeando que haya escrito algo en el nombre.            OK
  if (reserva.nombrep.value =="") {
           alert("Escriba su nombre");
		   reserva.nombrep.focus();
		   return (false);
                                  }
								  
								  
// Chequeando el email	!= true							        OK
//if (validarEmail(reserva.correo.value)) {
  //                      alert("Escriba su correo electronico correctamente.");
	//					reserva.correo.focus();
		//				return (false);
          //                                      }

if (reserva.correo.value.indexOf('@', 0) == -1 || reserva.correo.value.indexOf('.', 0) == -1)  { 
                alert("Dirección de e-mail inválida"); 
				reserva.correo.focus(); 
				return(false); 
				                }

 

// Chequeando la direccion de la casa                         OK
  if (reserva.direccionc.value =="") {
           alert("Escriba la dirección de la casa ");
		   reserva.direccionc.focus();
		   return (false);
                                  }	

// Chequeando la cantidad de habitaciones              

  if (reserva.habitaciones.value =="") {
           alert("Elija la cantidad de habitaciones ");
		   reserva.habitaciones.focus();
		   return (false);
                                  }	

//Chequeando la cantidad de habitaciones independientes
if (reserva.independientes.value =="") {
           alert("Seleccione la cantidad habitaciones independientes");
		   reserva.independientes.focus();
		   return (false);
                                  }	

//Chequeando el precio de las habitaciones
if (reserva.precio.value =="") {
           alert("Seleccione el precio de las habitaciones");
		   reserva.precio.focus();
		   return (false);
                                  } 





//Chequeando el numero de telefono
if (reserva.telefono.value =="") {
           alert("Escriba el número de teléfono");
		   reserva.telefono.focus();
		   return (false);
                                  } 



};

