// JavaScript Document

function ValidarReservacionesForm() {
	var Form = document.ReservacionesForm;
	var msg=''; var msg2='';
	//alert (Form);
	//NOMBRE
	if (Form.nombre.value.length==0) {
		msg+="Debe escribir su nombre completo.\n";
		Form.nombre.focus();
	}
	//EMAIL
	if (Form.email.value.length==0) {
		msg+="Debe escribir una cuenta de Email.\n";
		Form.email.focus();
	} else {
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if (!filter.test(Form.email.value)) {
			msg+="La cuenta de Email no es valida.\n";
			Form.email.focus();
		}
	}
	//TELEFONO
	if (Form.telefono.value.length==0) {
		msg+="Debe escribir al menos un numero de telefono.\n";
		Form.telefono.focus();
	}
	//FECHA LLEGADA
	if (Form.dia_llegada.value.length==0 || Form.dia_llegada.value=="--") {
		msg2="Debe seleccionar una fecha de llegada valida.\n";
		Form.dia_llegada.focus();
	}
	if (Form.mes_llegada.value.length==0 || Form.mes_llegada.value=="--") {
		msg2="Debe seleccionar una fecha de llegada valida.\n";
		Form.dia_llegada.focus();
	}
	if (Form.anio_llegada.value.length==0 || Form.anio_llegada.value=="----") {
		msg2="Debe seleccionar una fecha de llegada valida.\n";
		Form.dia_llegada.focus();
	}
	msg+=msg2;
	msg2='';
	//FECHA SALIDA
	if (Form.dia_salida.value.length==0 || Form.dia_salida.value=="--") {
		msg2="Debe seleccionar una fecha de salida valida.\n";
		Form.dia_salida.focus();
	}
	if (Form.mes_salida.value.length==0 || Form.mes_salida.value=="--") {
		msg2="Debe seleccionar una fecha de salida valida.\n";
		Form.dia_salida.focus();
	}
	if (Form.anio_salida.value.length==0 || Form.anio_salida.value=="----") {
		msg2="Debe seleccionar una fecha de salida valida.\n";
		Form.dia_salida.focus();
	}
	msg+=msg2;
	//ADULTOS
	if (Form.adultos.value.length==0 || Form.adultos.value=="--") {
		msg+="El numero de adultos no es valido.\n";
		Form.adultos.focus();
	}
	//NI&ntilde;OS
	if (Form.ninios.value.length==0 || Form.ninios.value=="--") {
		msg+="El numero de ninos no es valido.\n";
		Form.ninios.focus();
	}
	//AEROLINEA
	/*
	if (Form.aerolinea.value.length==0 || Form.aerolinea.value=="--") {
		msg+="La aerolinea seleccionada no es valida.\n";
		Form.aerolinea.focus();
	}
	//NUMERO DE VUELO
	if (Form.novuelo.value.length==0) {
		msg+="El numero de vuelo no es valido.\n";
		Form.novuelo.focus();
	}
	//HORA DE LLEGADA
	if (Form.horallegada.value.length==0 || Form.horallegada.value=="--:--") {
		msg+="La hora de llegada no es valida.\n";
		Form.horallegada.focus();
	}*/

	
	if (msg.length>0)
		alert (msg);
	else
		Form.submit();
}
