// Esta funcion es valida solo para el grupo de ficheros para Reservas


function Validar(){
    var txt = "Error en los siguientes campos: \n\n";
	msg_f = txt.length;

if (document.ValidarReserva.nombre.value == "")
	{
	 document.ValidarReserva.nombre.style.backgroundColor = "#C3C3C3"
	 txt+="\tNombre\n";
	}

if (document.ValidarReserva.dni.value == "")
	{
	document.ValidarReserva.dni.style.backgroundColor = "#C3C3C3"
	 txt+="\tSu DNI\n";
	}

if (document.ValidarReserva.direccion.value == "")
	{
	document.ValidarReserva.direccion.style.backgroundColor = "#C3C3C3"
	 txt+="\tDirección\n";
	}

if (document.ValidarReserva.poblacion.value == "")
	{
	document.ValidarReserva.poblacion.style.backgroundColor = "#C3C3C3"
	 txt+="\tPoblacion\n";
	}

if (document.ValidarReserva.telefono.value == "")
	{
	 document.ValidarReserva.telefono.style.backgroundColor = "#C3C3C3"
	 txt+="\tTelefono\n";
	}

if (document.ValidarReserva.dia_entrada.selectedIndex == 0)
	{
 	 document.ValidarReserva.dia_entrada.style.backgroundColor = "#C3C3C3"
	 txt+="\tDia de Entrada\n";
	}

if (document.ValidarReserva.mes_entrada.selectedIndex == 0)
	{
	document.ValidarReserva.mes_entrada.style.backgroundColor = "#C3C3C3"
	txt+="\tMes de Entrada\n";
	}

if (document.ValidarReserva.dia_salida.selectedIndex == 0)
	{
	 document.ValidarReserva.dia_salida.style.backgroundColor = "#C3C3C3"
	 txt+="\tDia de Salida\n";
	}

if (document.ValidarReserva.mes_salida.selectedIndex == 0)
	{
	 document.ValidarReserva.mes_salida.style.backgroundColor = "#C3C3C3"
	 txt+="\tMes de Salida\n";
	}
	
if (document.ValidarReserva.tipo_habitacion.selectedIndex == 0)
	{
	 document.ValidarReserva.tipo_habitacion.style.backgroundColor = "#C3C3C3"
	 txt+="\tTipo de Habitación\n";
	}
	
if (document.ValidarReserva.numero_habitaciones.selectedIndex == 0)
	{
	 document.ValidarReserva.numero_habitaciones.style.backgroundColor = "#C3C3C3"
	 txt+="\tNúmero de Habitaciones\n";
	}

if(document.ValidarReserva.aceptar_condiciones.checked == false )
	{
	document.ValidarReserva.aceptar_condiciones.style.backgroundColor = "#C3C3C3"
	txt+="\tAceptar Condiciones \n";
	}


if (msg_f != txt.length){
	alert(txt);
	return false;
	}else{
		return true;
	}
}




function TestMail(texto)
{
  var correcto=true;
  if ((texto.indexOf("@")<1) || (texto.indexOf("@")>8))
    { correcto=false; }
  if ( (texto.indexOf(".com")<0) &&  (texto.indexOf(".do")<0) && (texto.indexOf(".cu")<0) && (texto.indexOf(".cl")<0) && (texto.indexOf(".br")<0) && (texto.indexOf(".ch")<0) && (texto.indexOf(".pt")<0) && (texto.indexOf(".it")<0) && (texto.indexOf(".uk")<0) && (texto.indexOf(".mx")<0) && (texto.indexOf(".ar")<0) && (texto.indexOf(".de")<0) && (texto.indexOf(".fr")<0) && (texto.indexOf(".biz")<0) && (texto.indexOf(".info")<0) && (texto.indexOf(".net")<0) && (texto.indexOf(".es")<0)  && (texto.indexOf(".org")<0) &&  (texto.indexOf(".edu")<0) )
    { correcto=false; }
  
return correcto;
}

