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

function antispam(a,b) {
    document.location.href='mailto:'+a+'@'+b;
}


function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}


<!-- modulo contatti -->
function Modulo() {
    var nome = document.modulo.nome.value;
    var cognome = document.modulo.cognome.value;
    var telefono = document.modulo.telefono.value;
    var email = document.modulo.email.value;
    var info = document.modulo.info.value;
	var privacy = document.modulo.privacy.checked;

    var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

    if ((nome == "") || (nome == "undefined")) {
        alert("Il campo Nome è obbligatorio.");
        document.modulo.nome.focus();
        return false;
    }
    else if ((cognome == "") || (cognome == "undefined")) {
       alert("Il campo Cognome è obbligatorio.");
       document.modulo.cognome.focus();
       return false;
    }
    else if ((isNaN(telefono)) || (telefono == "") || (telefono == "undefined")) {
       alert("Il campo Telefono è numerico senza spazi ed obbligatorio.");
       document.modulo.telefono.value = "";
       document.modulo.telefono.focus();
       return false;
    }
    else if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) {
       alert("Inserire un indirizzo email corretto.");
       document.modulo.email.select();
       return false;
    }
    else if ((info == "") || (info == "undefined") || (info.indexOf("Inserisci qui il tuo slogan!") != (-1))) {
       alert("Il campo Messaggio è obbligatorio.");
       document.modulo.info.focus();
       return false;
    } 
	else if ((privacy == false) || (privacy == "undefined")) {
           alert("E' necessario accettare l'informativa sulla privacy.");
           document.modulo.privacy.focus();
           return false;
        }
	else {
        return true;
    }
}


<!-- modulo contatti EN -->
function Modulo_en() {
    var nome = document.modulo.nome.value;
    var cognome = document.modulo.cognome.value;
    var telefono = document.modulo.telefono.value;
    var email = document.modulo.email.value;
    var info = document.modulo.info.value;
	var privacy = document.modulo.privacy.checked;

    var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

    if ((nome == "") || (nome == "undefined")) {
        alert("The name is required.");
        document.modulo.nome.focus();
        return false;
    }
    else if ((cognome == "") || (cognome == "undefined")) {
       alert("Last name is required.");
       document.modulo.cognome.focus();
       return false;
    }
    else if ((isNaN(telefono)) || (telefono == "") || (telefono == "undefined")) {
       alert("The Phone field is numeric with no spaces and obligatory.");
       document.modulo.telefono.value = "";
       document.modulo.telefono.focus();
       return false;
    }
    else if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) {
       alert("Enter a valid email address.");
       document.modulo.email.select();
       return false;
    }
    else if ((info == "") || (info == "undefined") || (info.indexOf("Inserisci qui il tuo slogan!") != (-1))) {
       alert("The Message field is required.");
       document.modulo.info.focus();
       return false;
    } 
	else if ((privacy == false) || (privacy == "undefined")) {
           alert("You must accept the privacy policy.");
           document.modulo.privacy.focus();
           return false;
        }
	else {
        return true;
    }
}



<!-- modulo contatti DE -->
function Modulo_de() {
    var nome = document.modulo.nome.value;
    var cognome = document.modulo.cognome.value;
    var telefono = document.modulo.telefono.value;
    var email = document.modulo.email.value;
    var info = document.modulo.info.value;
	var privacy = document.modulo.privacy.checked;

    var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

    if ((nome == "") || (nome == "undefined")) {
        alert("Der Name ist erforderlich.");
        document.modulo.nome.focus();
        return false;
    }
    else if ((cognome == "") || (cognome == "undefined")) {
       alert("Nachname ist erforderlich.");
       document.modulo.cognome.focus();
       return false;
    }
    else if ((isNaN(telefono)) || (telefono == "") || (telefono == "undefined")) {
       alert("The Phone Feld numerisch ist ohne Leerzeichen oder Pflichtarbeit.");
       document.modulo.telefono.value = "";
       document.modulo.telefono.focus();
       return false;
    }
    else if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) {
       alert("Geben Sie eine gültige E-Mail Adresse.");
       document.modulo.email.select();
       return false;
    }
    else if ((info == "") || (info == "undefined") || (info.indexOf("Inserisci qui il tuo slogan!") != (-1))) {
       alert("Die Botschaft ist erforderlich.");
       document.modulo.info.focus();
       return false;
    } 
	else if ((privacy == false) || (privacy == "undefined")) {
           alert("Sie müssen akzeptiere die Datenschutzerklärung.");
           document.modulo.privacy.focus();
           return false;
        }
	else {
        return true;
    }
}

<!-- modulo prenota -->
function Modulo2() {
    var nome = document.modulo.nome.value;
    var cognome = document.modulo.cognome.value;
    var email = document.modulo.email.value;
	var telefono = document.modulo.telefono.value;
    var gga = document.modulo.gga.value;
	var mma = document.modulo.mma.value;
	var aaaaa = document.modulo.aaaaa.value;
	var ggp = document.modulo.ggp.value;
	var mmp = document.modulo.mmp.value;
	var aaaap = document.modulo.aaaap.value;
    var adulti = document.modulo.adulti.value;
    var bambini = document.modulo.bambini.value;
	camera1 = document.getElementById('camera1');
    camera2 = document.getElementById('camera2');
	var privacy = document.modulo.privacy.checked;
    
    var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

    if ((nome == "") || (nome == "undefined")) {
        alert("Il campo Nome è obbligatorio.");
        document.modulo.nome.focus();
        return false;
    }
    else if ((cognome == "") || (cognome == "undefined")) {
       alert("Il campo Cognome è obbligatorio.");
       document.modulo.cognome.focus();
       return false;
    }
	else if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) {
       alert("Inserire un indirizzo email corretto.");
       document.modulo.email.select();
       return false;
    }
    else if ((isNaN(telefono)) || (telefono == "") || (telefono == "undefined")) {
       alert("Il campo Telefono è numerico senza spazi ed obbligatorio.");
       document.modulo.telefono.value = "";
       document.modulo.telefono.focus();
       return false;
    }
	else if ((isNaN(gga)) || (gga == "") || (gga == "undefined")) {
       alert("Indicare in maniera numerica il giorno di Arrivo.");
       document.modulo.gga.value = "";
       document.modulo.gga.focus();
       return false;
    }
	else if ((isNaN(mma)) || (mma == "") || (mma == "undefined")) {
       alert("Indicare in maniera numerica il mese di Arrivo.");
       document.modulo.mma.value = "";
       document.modulo.mma.focus();
       return false;
    }
	else if ((isNaN(aaaaa)) || (aaaaa == "") || (aaaaa == "undefined")) {
       alert("Indicare in maniera numerica l'anno.");
       document.modulo.aaaaa.value = "";
       document.modulo.aaaaa.focus();
       return false;
    }
		else if ((isNaN(ggp)) || (ggp == "") || (ggp == "undefined")) {
       alert("Indicare in maniera numerica il giorno di Partenza.");
       document.modulo.ggp.value = "";
       document.modulo.ggp.focus();
       return false;
    }
	else if ((isNaN(mmp)) || (mmp == "") || (mmp == "undefined")) {
       alert("Indicare in maniera numerica il mese di Partenza.");
       document.modulo.mmp.value = "";
       document.modulo.mmp.focus();
       return false;
    }
	else if ((isNaN(aaaap)) || (aaaap == "") || (aaaap == "undefined")) {
       alert("Indicare in maniera numerica l'anno.");
       document.modulo.aaaap.value = "";
       document.modulo.aaaap.focus();
       return false;
    }
	else if ((isNaN(adulti)) || (adulti == "") || (adulti == "undefined")) {
       alert("Indicare il numero di adulti.");
       document.modulo.adulti.value = "";
       document.modulo.adulti.focus();
       return false;
    }
	else if ((isNaN(bambini)) || (bambini == "") || (bambini == "undefined")) {
       alert("Indicare il numero di bambini.");
       document.modulo.bambini.value = "";
       document.modulo.bambini.focus();
       return false;
    }
	 else if (camera1.checked == false && camera2.checked == false) {
        alert('Selezionare il tipo di camera.');
        camera1.focus();
        return false;
    }
	else if ((privacy == false) || (privacy == "undefined")) {
           alert("E' necessario accettare l'informativa sulla privacy.");
           document.modulo.privacy.focus();
           return false;
    }
    else {
        return true;
    }
}


<!-- modulo prenota EN -->
function Modulo2_en() {
    var nome = document.modulo.nome.value;
    var cognome = document.modulo.cognome.value;
    var email = document.modulo.email.value;
	var telefono = document.modulo.telefono.value;
    var gga = document.modulo.gga.value;
	var mma = document.modulo.mma.value;
	var aaaaa = document.modulo.aaaaa.value;
	var ggp = document.modulo.ggp.value;
	var mmp = document.modulo.mmp.value;
	var aaaap = document.modulo.aaaap.value;
    var adulti = document.modulo.adulti.value;
    var bambini = document.modulo.bambini.value;
	camera1 = document.getElementById('camera1');
    camera2 = document.getElementById('camera2');
	var privacy = document.modulo.privacy.checked;
    
    var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

    if ((nome == "") || (nome == "undefined")) {
        alert("The name is required.");
        document.modulo.nome.focus();
        return false;
    }
    else if ((cognome == "") || (cognome == "undefined")) {
       alert("Last name is required.");
       document.modulo.cognome.focus();
       return false;
    }
	else if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) {
       alert("Enter a valid email address.");
       document.modulo.email.select();
       return false;
    }
    else if ((isNaN(telefono)) || (telefono == "") || (telefono == "undefined")) {
       alert("The Phone field is numeric with no spaces and obligatory.");
       document.modulo.telefono.value = "";
       document.modulo.telefono.focus();
       return false;
    }
	else if ((isNaN(gga)) || (gga == "") || (gga == "undefined")) {
       alert("Indicated in the numerical day of Arrival.");
       document.modulo.gga.value = "";
       document.modulo.gga.focus();
       return false;
    }
	else if ((isNaN(mma)) || (mma == "") || (mma == "undefined")) {
       alert("Indicated in the numeric month of Arrival.");
       document.modulo.mma.value = "";
       document.modulo.mma.focus();
       return false;
    }
	else if ((isNaN(aaaaa)) || (aaaaa == "") || (aaaaa == "undefined")) {
       alert("Indicated in numerical year.");
       document.modulo.aaaaa.value = "";
       document.modulo.aaaaa.focus();
       return false;
    }
		else if ((isNaN(ggp)) || (ggp == "") || (ggp == "undefined")) {
       alert("Indicated in the numerical day of departure.");
       document.modulo.ggp.value = "";
       document.modulo.ggp.focus();
       return false;
    }
	else if ((isNaN(mmp)) || (mmp == "") || (mmp == "undefined")) {
       alert("Indicated in the numeric month of departure.");
       document.modulo.mmp.value = "";
       document.modulo.mmp.focus();
       return false;
    }
	else if ((isNaN(aaaap)) || (aaaap == "") || (aaaap == "undefined")) {
       alert("Indicated in numerical year.");
       document.modulo.aaaap.value = "";
       document.modulo.aaaap.focus();
       return false;
    }
	else if ((isNaN(adulti)) || (adulti == "") || (adulti == "undefined")) {
       alert("Indicate the number of adults.");
       document.modulo.adulti.value = "";
       document.modulo.adulti.focus();
       return false;
    }
	else if ((isNaN(bambini)) || (bambini == "") || (bambini == "undefined")) {
       alert("Indicate the number of children.");
       document.modulo.bambini.value = "";
       document.modulo.bambini.focus();
       return false;
    }
	 else if (camera1.checked == false && camera2.checked == false) {
        alert('Select the type of room.');
        camera1.focus();
        return false;
    }
	else if ((privacy == false) || (privacy == "undefined")) {
           alert("You must accept the privacy policy.");
           document.modulo.privacy.focus();
           return false;
    }
    else {
        return true;
    }
}

<!-- modulo prenota DE -->
function Modulo2_de() {
    var nome = document.modulo.nome.value;
    var cognome = document.modulo.cognome.value;
    var email = document.modulo.email.value;
	var telefono = document.modulo.telefono.value;
    var gga = document.modulo.gga.value;
	var mma = document.modulo.mma.value;
	var aaaaa = document.modulo.aaaaa.value;
	var ggp = document.modulo.ggp.value;
	var mmp = document.modulo.mmp.value;
	var aaaap = document.modulo.aaaap.value;
    var adulti = document.modulo.adulti.value;
    var bambini = document.modulo.bambini.value;
	camera1 = document.getElementById('camera1');
    camera2 = document.getElementById('camera2');
	var privacy = document.modulo.privacy.checked;
    
    var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

    if ((nome == "") || (nome == "undefined")) {
        alert("Der Name ist erforderlich.");
        document.modulo.nome.focus();
        return false;
    }
    else if ((cognome == "") || (cognome == "undefined")) {
       alert("Nachname ist erforderlich.");
       document.modulo.cognome.focus();
       return false;
    }
	else if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) {
       alert("Geben Sie eine gültige E-Mail Adresse.");
       document.modulo.email.select();
       return false;
    }
    else if ((isNaN(telefono)) || (telefono == "") || (telefono == "undefined")) {
       alert("The Phone Feld numerisch ist ohne Leerzeichen oder Pflichtarbeit.");
       document.modulo.telefono.value = "";
       document.modulo.telefono.focus();
       return false;
    }
	else if ((isNaN(gga)) || (gga == "") || (gga == "undefined")) {
       alert("Indiziert bei der numerischen Tag der Anreise.");
       document.modulo.gga.value = "";
       document.modulo.gga.focus();
       return false;
    }
	else if ((isNaN(mma)) || (mma == "") || (mma == "undefined")) {
       alert("Indiziert bei der numerischen Monat Anreise.");
       document.modulo.mma.value = "";
       document.modulo.mma.focus();
       return false;
    }
	else if ((isNaN(aaaaa)) || (aaaaa == "") || (aaaaa == "undefined")) {
       alert("Indiziert in numerischer Jahr.");
       document.modulo.aaaaa.value = "";
       document.modulo.aaaaa.focus();
       return false;
    }
		else if ((isNaN(ggp)) || (ggp == "") || (ggp == "undefined")) {
       alert("Indiziert bei der numerischen Tag der Abreise.");
       document.modulo.ggp.value = "";
       document.modulo.ggp.focus();
       return false;
    }
	else if ((isNaN(mmp)) || (mmp == "") || (mmp == "undefined")) {
       alert("Indiziert bei der numerischen Monat Abreise.");
       document.modulo.mmp.value = "";
       document.modulo.mmp.focus();
       return false;
    }
	else if ((isNaN(aaaap)) || (aaaap == "") || (aaaap == "undefined")) {
       alert("Indiziert in numerischer Jahr.");
       document.modulo.aaaap.value = "";
       document.modulo.aaaap.focus();
       return false;
    }
	else if ((isNaN(adulti)) || (adulti == "") || (adulti == "undefined")) {
       alert("Geben Sie die Anzahl der Erwachsenen.");
       document.modulo.adulti.value = "";
       document.modulo.adulti.focus();
       return false;
    }
	else if ((isNaN(bambini)) || (bambini == "") || (bambini == "undefined")) {
       alert("Geben Sie die Anzahl der Kinder.");
       document.modulo.bambini.value = "";
       document.modulo.bambini.focus();
       return false;
    }
	 else if (camera1.checked == false && camera2.checked == false) {
        alert('Wählen Sie die Art des Zimmers.');
        camera1.focus();
        return false;
    }
	else if ((privacy == false) || (privacy == "undefined")) {
           alert("Sie müssen akzeptiere die Datenschutzerklärung.");
           document.modulo.privacy.focus();
           return false;
    }
    else {
        return true;
    }
}



function privacy(apri) {
    var stile = "top=300, left=350, width=600, height=350, status=no, menubar=no, toolbar=no, scrollbars=yes, resizable=yes";
    window.open(apri, "", stile);
}


function openPicture(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
    newWindow = window.open('',"newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
    newWindow.document.open();
    newWindow.document.write('<html><HEAD><title>Hotel La Palma - Zoom</title></HEAD><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">');
    newWindow.document.write('<img src="'+imageName+'" width="'+imageWidth+'" height="'+imageHeight+'" alt="'+alt+'">');
    newWindow.document.write('</body></html>');
    newWindow.document.close();
    newWindow.focus();
}

function openPrint(url,w,h,pleft,ptop) {
    newWindow = window.open(url,"newWindow","width="+w+",height="+h+",left="+pleft+",top="+ptop);
    newWindow.print();
}

function book(apri) {
    var stile = "top=300, left=350, width=980, height=550, status=no, menubar=no, toolbar=no, scrollbars=yes, resizable=yes";
    window.open(apri, "", stile);
}

  function popWin( url, name, width, height, scroller )
{
var outStr = 'height=' + height + ',width=' + width;
if (scroller != 'true') {
outStr = outStr + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no, resizable=no';
}
else {
outStr = outStr + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no, resizable=no';
}
window.open(url, name, outStr);
}

function popWin2( url, name, width, height, scroller )
{
var outStr = 'height=' + height + ',width=' + width;
if (scroller != 'true') {
outStr = outStr + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes, resizable=no';
}
else {
outStr = outStr + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no, resizable=no';
}
window.open(url, name, outStr);
}


function conferma(messaggio, url) {
    if (confirm(messaggio)) {
        document.location.href = url;
    }
    return false;
}

function localecopy(field, from) {
    nome = field+'_'+from;
    campoin = document.getElementById(nome);
    for (locale in js_locales) {
        valore = js_locales[locale];
        if (valore == 'it' || valore == from) {
        } else {
            nomeout = field+'_'+valore;
            campoout = document.getElementById(nomeout);
            campoout.value = campoin.value;
        }

    }
}


