function Enviar(){
	if (trim(document.Formulario.Nombre.value)==""){alert('Introduzca su nombre');return; }
	if (document.Formulario.Email.value.length<1){alert('Introduzca su email');return;}
	if (!validarEmail(document.Formulario.Email.value)){alert('El email introducido no es correcto');return;}
	document.Formulario.submit();
}
function Enviar2(){
	if (trim(document.Formulario2.Nombre.value)==""){alert('Introduzca su nombre');return; }
	if (document.Formulario2.Email.value.length<1){alert('Introduzca su email');return;}
	if (!validarEmail(document.Formulario2.Email.value)){alert('El email introducido no es correcto');return;}
	if (trim(document.Formulario2.Destino.value)==""){alert('Introduzca el destino y las fechas');return; }
	if (trim(document.Formulario2.Telefono.value)==""){alert('Introduzca su teléfono');return; }

	if (document.all.Verif2.value!=document.all.Verif1.value){
		alert('Introduzca el código de verificación que aparece');
		return;
	}

	document.Formulario2.submit();
}

function rand ( n ){
  return ( Math.floor ( Math.random ( ) * n + 1 ) );
}

function CargarVerif(){
	Aux=999+rand(8000);
	document.all.dVerif.innerHTML="<b>"+Aux+"</b>";
	document.all.Verif2.value=Aux;
}
function AbrirLOPD(){
var myLeft;var myTop;

myLeft = (screen.width-700)/2;
myTop = (screen.height-330)/2;
vent=window.open('politica-privacidad-lopd.php', 'modi', 'scrollbars=no,height=330,width=700,left='+myLeft+',top='+myTop);
}
function LlenarEdades(){
		for (i=1;i<=12;i++){
			cbo=eval('document.all.cboEdad'+i);
			for (j=0;j<=99;j++){
				var newOpt = cbo.appendChild(document.createElement('option'));
				newOpt.text = j;
				newOpt.value = j;
				if (j==30){newOpt.selected=true;}
			}
		}
}

function CancelarBusqueda (){

		document.getElementById('dHotel').style.display='none';
		document.getElementById("capaFondo1").style.visibility="hidden"; 
		//document.getElementById("capaBusqueda").style.display="block"; 
		
}
function RefrescarCruceros(){
	var IdNaviera = document.all.Nav.value;
	var Salida = document.all.Salida.value;
	var Duracion = document.all.Duracion.value;
	var mar = document.all.mar.value;
	var ciudad = document.all.ciudad.value;
	
	var date = new Date();
	var URL = "req/Consulta.php?Nav="+IdNaviera+"&Salida="+Salida+"&Duracion="+Duracion+"&mar="+mar+"&ciudad="+ciudad+"&nocache="+date;
	xmlHttp = GetXmlHttpObject(StateChangeHandlerDatosCliente);
	XmlHttp_Get(xmlHttp, URL);	
}
function StateChangeHandlerDatosCliente(){
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete') {
		if (xmlHttp.status == 200){
			document.all.cruceros.innerHTML=xmlHttp.responseText;
		}
	}else{
        document.all.cruceros.innerHTML = '<img src="img/cargando.gif" width="16px" height="16px"/>';
	}
}
