// JavaScript Document

var testresultscontactar
var testresultsreservas

function checkemail_contactar(){
var str=document.formulario_contactar.email.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
	testresultscontactar=true
else{
	alert("Tu email no es válido!!!")
	testresultscontactar=false
}
	return (testresultscontactar)
}

function checkemail_contactar_eng(){
var str=document.formulario_contactar_eng.email.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
	testresultscontactar=true
else{
	alert("Your email is not valid!!!")
	testresultscontactar=false
}
	return (testresultscontactar)
}

function checkemail_reservas(){
var str=document.formulario_reservas.email.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
	testresultsreservas=true
else{
	alert("Tu email no es válido!!!")
	testresultsreservas=false
}
	return (testresultsreservas)
}

function checkemail_reservas_eng(){
var str=document.formulario_reservas_eng.email.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
	testresultsreservas=true
else{
	alert("Your email is not valid!!!")
	testresultsreservas=false
}
	return (testresultsreservas)
}

function enviar_contactar()
{
    if (document.formulario_contactar.Nombre_y_Apellidos.value == '') {
        alert('No se ha introducido un valor para "Nombre y Apellidos"');
		formulario_contactar.Nombre_y_Apellidos.focus();
    }
	else if ((document.formulario_contactar.Telefono.value == '') && (document.formulario_contactar.email.value == '')) {
        alert('No se ha introducido una forma de contacto: Teléfono o Email');
    }
    else if (document.formulario_contactar.Observaciones.value == '') {
        alert('No se ha introducido un valor para "Observaciones"');
		formulario_contactar.Observaciones.focus();
    }
    else {
		if (checkemail_contactar()==true) document.formulario_contactar.submit();
    }
}

function enviar_contactar_eng()
{
    if (document.formulario_contactar_eng.Nombre_y_Apellidos.value == '') {
        alert('One has not introduced a value for "Name & Surname"');
		formulario_contactar_eng.Nombre_y_Apellidos.focus();
    }
	else if ((document.formulario_contactar_eng.Telefono.value == '') && (document.formulario_contactar_eng.email.value == '')) {
        alert('A contact form has not been introduced: "Telefone number or Email"');
    }
    else if (document.formulario_contactar_eng.Observaciones.value == '') {
        alert('One has not introduced a value for "Your message"');
		formulario_contactar_eng.Observaciones.focus();
    }
    else {
		if (checkemail_contactar_eng()==true) document.formulario_contactar_eng.submit();
    }
}

function enviar_reservas()
{
    if (document.formulario_reservas.Nombre_y_Apellidos.value == '') {
        alert('No se ha introducido un valor para "Nombre y Apellidos"');
		formulario_reservas.Nombre_y_Apellidos.focus();
    }
	else if ((document.formulario_reservas.Telefono.value == '') && (document.formulario_reservas.email.value == '')) {
        alert('No se ha introducido una forma de contacto: Teléfono o Email');
    }
    else if (document.formulario_reservas.Observaciones.value == '') {
        alert('No se ha introducido un valor para "Observaciones"');
		formulario_reservas.Observaciones.focus();
    }
    else {
		if (checkemail_reservas()==true) document.formulario_reservas.submit();
    }
}

function enviar_reservas_eng()
{
    if (document.formulario_reservas_eng.Nombre_y_Apellidos.value == '') {
        alert('One has not introduced a value for "Name & Surname"');
		formulario_reservas_eng.Nombre_y_Apellidos.focus();
    }
	else if ((document.formulario_reservas_eng.telefono.value == '') && (document.formulario_reservas_eng.email.value == '')) {
        alert('A contact form has not been introduced: "Telefone number or Email"');
    }
    else if (document.formulario_reservas_eng.Informacion.value == '') {
        alert('One has not introduced a value for "Your Questions"');
		formulario_reservas_eng.Informacion.focus();
    }
    else {
		if (checkemail_reservas_eng()==true) document.formulario_reservas_eng.submit();
    }
}

function borrar_contactar()
{
	formulario_contactar.reset();
}

function borrar_contactar_eng()
{
	formulario_contactar_eng.reset();
}

function borrar_reservas()
{
	formulario_reservas.reset();
}

function borrar_reservas_eng()
{
	formulario_reservas_eng.reset();
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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_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_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];}
}

// Variables de color para el menú
var menuColor1 = "#28592c";
var menuColor1over = "#889E5A";
var menuColor2 = "#FAF8CC";
var menuColor2over = "#ddd97d";

function cambiaColorMenu(src)
{
	if (src.bgColor.toLowerCase()==menuColor1.toLowerCase()) {src.bgColor=menuColor1over;}
	else if (src.bgColor.toLowerCase()==menuColor1over.toLowerCase()) {src.bgColor=menuColor1;}
	else if (src.bgColor.toLowerCase()==menuColor2.toLowerCase()) {src.bgColor=menuColor2over;}
	else if (src.bgColor.toLowerCase()==menuColor2over.toLowerCase()) {src.bgColor=menuColor2;}
}

function openPictureWindow_Fever(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {  // v4.01
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	if (imageType == "swf"){
	newWindow.document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('<param name=movie value=\"'+imageName+'\"><param name=quality value=high>');
	newWindow.document.write('<embed src=\"'+imageName+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('</embed></object>');	}else{
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">'); 	}
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

function openPictureWindow_Fever_Mod(imageType,imageName,imageWidth,imageHeight,alt,desc,posLeft,posTop) {  // v4.01

	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0 align="center">');
	newWindow.document.write('<TR><TD BGCOLOR="#899D5E" align="center"><FONT COLOR=white FACE=Arial SIZE=2><b>'+alt+'</b></FONT></TD></TR>');
	newWindow.document.write('<TR><TD align="center" bgcolor="#FFFFFF">');
	if (imageType == "swf"){
	newWindow.document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+imageWidth+'" height="'+imageHeight+'">');
	newWindow.document.write('<param name=movie value="'+imageName+'"><param name=quality value=high>');
	newWindow.document.write('<embed src="'+imageName+'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+imageWidth+'" height="'+imageHeight+'">');
	newWindow.document.write('</embed></object>');	}else{
	newWindow.document.write('<img src="'+imageName+'" alt="'+alt+'">'); 	}
	newWindow.document.write('</TD></TR>');
	newWindow.document.write('<TR><TD BGCOLOR="#DBE1B0" align="center">');
	newWindow.document.write('<FONT COLOR=black FACE=Arial SIZE=2>'+desc+'</FONT>');
	newWindow.document.write('</TD></TR></TABLE>');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();

}

function enviar_activacion()
{
    if (document.formulario_activacion.name.value == '') {
        alert('No se ha introducido un valor para "Nombre Real"');
		formulario_activacion.name.focus();
    }
    else if (document.formulario_activacion.email.value == '') {
        alert('No se ha introducido un valor para "Email"');
		formulario_activacion.email.focus();
    }
    else if (document.formulario_activacion.ciudad.value == '') {
        alert('No se ha introducido un valor para "Ciudad"');
		formulario_activacion.ciudad.focus();
    }
    else if (document.formulario_activacion.pais.value == '') {
        alert('No se ha introducido un valor para "Pais"');
		formulario_activacion.pais.focus();
    }
    else {
		document.formulario_activacion.submit();
    }
}

function enviar_desactivacion()
{
    if (document.formulario_desactivacion.name.value == '') {
        alert('No se ha introducido un valor para "Nombre Real"');
		formulario_desactivacion.name.focus();
    }
    else if (document.formulario_desactivacion.email.value == '') {
        alert('No se ha introducido un valor para "Email"');
		formulario_desactivacion.email.focus();
    }
    else {
		document.formulario_desactivacion.submit();
    }
}
