function CalendarioFecha(ref,hoy,formu,x,ev,color,color2)
{ 
	var px, py, cadena, obj;
	if (!document.all)
		   {
		   event = ev;
		   py = ev.pageY; 
		   px = ev.pageX;
		   }
	else{
		   py = event.clientY +document.body.scrollTop; 
		   px = event.clientX +document.body.scrollLeft;
		   }
	if (document.getElementById('fecha').value==""){
	 	window.parent.frames["calen"].location="calendario_select.asp?campo=fecha&ln=" + ref + "&color=" + color + "&color2=" + color2 + "&fecha=" + hoy;
	}
	else {
		window.parent.frames["calen"].location="calendario_select.asp?campo=fecha&ln=" + ref + "&color=" + color + "&color2=" + color2 + "&fecha=" + document.getElementById('fecha').value;
	}
	
	 document.getElementById('calendario').style.left = x;
	 document.getElementById('calendario').style.top = py-65;
	 document.getElementById('calendario').style.visibility = "visible";
	 
}

function CalendarioLlegada(ref,hoy,formu,x,y,color,color2)
{ 
	if (document.getElementById('llegada').value==""){
	 	window.parent.frames[0].location="calendario_select.asp?campo=llegada&ln=" + ref + "&color=" + color + "&color2=" + color2 + "&fecha=" + hoy;
	}
	else {
		window.parent.frames[0].location="calendario_select.asp?campo=llegada&ln=" + ref + "&color=" + color + "&color2=" + color2 + "&fecha=" + document.getElementById('llegada').value;
	}
	 document.getElementById('calendario').style.left = x;
	 document.getElementById('calendario').style.top = y;
	 document.getElementById('calendario').style.visibility = "visible";
	 
}
function CalendarioSalida(ref,hoy,formu,x,y,color,color2)
{ 
	if (document.getElementById('llegada').value==""){
	 	window.parent.frames[0].location="calendario_select.asp?campo=salida&ln=" + ref + "&color=" + color + "&color2=" + color2 + "&fecha=" + hoy;
	}
	else {
		window.parent.frames[0].location="calendario_select.asp?campo=salida&ln=" + ref + "&color=" + color + "&color2=" + color2 + "&fecha=" + document.getElementById('llegada').value;
	}
	 
	 document.getElementById('calendario').style.left = x;
	 document.getElementById('calendario').style.top = y;
	 document.getElementById('calendario').style.visibility = "visible";
	 
}
function CalendarioCerrar()
{ 
	 document.getElementById('calendario').style.visibility = "hidden";
	 
}

function CalendarioFijar(campo,valor,ln)
{ 
	document.getElementById(campo).value=valor;
	window.parent.frames["calendarios"].location="Calendarios_ifr.asp" + '?fecha=' + valor + "&ln=" + ln; 
	
}
function CalendarioResumen_Fijar(valor){
		
	var capo;
	capo =  document.getElementById('campofijar').value;
	if (capo=="llegada"){
		document.getElementById(capo).value = valor;
		document.getElementById('campofijar').value="salida";
		document.getElementById(capo).focus();
	}
	else{
		document.getElementById(capo).value = valor;
		document.getElementById('campofijar').value="llegada";
		document.getElementById(capo).focus();
	}
}
function CambiarFechaResumen(doc){
	 window.location=doc + '?fecha=' + document.getElementById('fecha').value ;
}
function GestionFormReserva(formu){
	
	if (formu.llegada.value == "") {
		alert(formu.llegadai.value + formu.vacio.value);
		return false;
	}
	
	if (formu.salida.value == "") {
		alert(formu.salidai.value + formu.vacio.value);
		return false;
	}
	
	if (formu.CodArticuloTipo.value == "0") {
		alert(formu.tipoi.value + formu.vacio.value);
		return false;
	}
	
	if (formu.adultos.value == "") {
		alert(formu.adultosi.value + formu.vacio.value);
		return false;
	}
	
	formu.submit();
	
}

function GestionFormContacto(formu){
	
	if (formu.nombre.value == "") {
		alert(formu.nombrei.value + formu.vacio2.value);
		return false;
	}
	
	if (formu.mail.value == "") {
		alert("E-mail" + formu.vacio2.value);
		return false;
	}
	
	if (formu.asunto.value == "") {
		alert(formu.asuntoi.value + formu.vacio2.value);
		return false;
	}
	
	if (formu.mensaje.value == "") {
		alert(formu.mensajei.value + formu.vacio2.value);
		return false;
	}
	
	document.getElementById('MensajeIco').style.display='inline';
	document.getElementById('MensajeIco').style.height=45;
	document.getElementById('MensajeTexto').style.display='inline';
	document.getElementById('MensajeTexto').innerHTML="Procesando......"
	formu.submit();
	
}

function GestionFormContacto_op(op){
	
	document.getElementById('MensajeIco').style.display='none';
	document.getElementById('MensajeIco').style.height=35;
	if (op=="ok"){
		document.getElementById('MensajeTexto').style.display='inline';
		document.getElementById('MensajeTexto').innerHTML = '<span class="Arial_contenido">' + document.getElementById('form_ok').value + '</span><br><br>';
		
		document.getElementById('nombre').value="";
		document.getElementById('mail').value="";
		document.getElementById('asunto').value="";
		document.getElementById('mensaje').value="";
	}
	else {
		document.getElementById('MensajeTexto').style.display='inline';
		document.getElementById('MensajeTexto').innerHTML = document.getElementById('form_mal').value + '</span><br><br>';
	}
	
}

function GestionFormOpinion(formu){
	
	if (formu.nombre.value == "") {
		alert(formu.nombrei.value + formu.vacio2.value);
		return false;
	}
	
	if (formu.mail.value == "") {
		alert("E-mail" + formu.vacio2.value);
		return false;
	}
	
	if (formu.valoracion.value == "x") {
		alert(formu.valoracioni.value + formu.vacio2.value);
		return false;
	}
	
	if (formu.comentario.value == "") {
		alert(formu.comentarioi.value + formu.vacio2.value);
		return false;
	}
	
	document.getElementById('MensajeIco').style.display='inline';
	document.getElementById('MensajeIco').style.height=45;
	document.getElementById('MensajeTexto').style.display='inline';
	document.getElementById('MensajeTexto').innerHTML="Procesando......"
	formu.submit();
	
}

function GestionFormOpinion_op(op){
	
	document.getElementById('MensajeIco').style.display='none';
	document.getElementById('MensajeIco').style.height=35;
	if (op=="ok"){
		document.getElementById('MensajeTexto').style.display='inline';
		document.getElementById('MensajeTexto').innerHTML = '<span class="Arial_contenido">' + document.getElementById('form_ok').value + '</span><br><br>';
		window.location='Opiniones.asp?ln=' + document.getElementById('ln').value
	}
	else {
		document.getElementById('MensajeTexto').style.display='inline';
		document.getElementById('MensajeTexto').innerHTML = document.getElementById('form_mal').value + '</span><br><br>';
	}
	
}

function GestionFormReservaCli(formu){
	
	if (formu.nombre.value == "") {
		alert(formu.nombrei.value + formu.vacio2.value);
		return false;
	}
	
	if (formu.pais.value == "") {
		alert(formu.paisi.value + formu.vacio2.value);
		return false;
	}
	
	if (formu.ciudad.value == "") {
		alert(formu.ciudadi.value + formu.vacio2.value);
		return false;
	}
	
	if (formu.mail.value == "") {
		alert("E-Mail" + formu.vacio2.value);
		return false;
	}
	
	if (formu.telefono.value == "") {
		alert(formu.telefonoi.value + formu.vacio2.value);
		return false;
	}
	
	if (formu.comentario.value == "") {
		alert(formu.comentarioi.value + formu.vacio2.value);
		return false;
	}
	
	formu.submit();
	
}

function BotonReservar_Over(){
	document.getElementById("btnreserva").src='images/Btn_Reserva_al.png';
}

function BotonReservar_Out(){
	document.getElementById("btnreserva").src='images/Btn_Reserva.png';
}

function BotonReservar_eng_Over(){
	document.getElementById("btnreserva").src='images/Btn_Reserva_eng_al.png';
}

function BotonReservar_eng_Out(){
	document.getElementById("btnreserva").src='images/Btn_Reserva_eng.png';
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
