// JavaScript Document
// Calendar ES (spanish) language 
// Author: SIHOT. 
// Updated: 17/09/2010
// Code for blue Template
// functions v1.

function delSpecial(a){a=a.replace(/(À|Á|Â|Ã|Ä|Å|Æ)/gi,"a");a=a.replace(/(È|É|Ê|Ë)/gi,"e");a=a.replace(/(Ì|Í|Î|Ï)/gi,"i");a=a.replace(/(Ò|Ó|Ô|Ö)/gi,"o");a=a.replace(/(Ù|Ú|Û|Ü)/gi,"u");return a}function vdfc(){var w=document.getElementById("name").value;var e=document.getElementById("direcm").value;var f=document.getElementById("phone").value;var l=document.getElementById("message").value;var j=document.getElementById("ln").value;w=delSpecial(w);l=delSpecial(l);var r=false;var s="";switch(j){case"es":var m="Por favor, rellene los campos indicados del formulario y pulse Realizar reservar:\n\n";var a=" *Indique un nombre de contacto.\n";var o=" *Indique un nombre de contacto válido.\n";var u=" *Sólo se permiten caracteres de la [a-z][A-Z].\n";var c=" *Indique una dirección de correo electrónico de contacto.\n";var h=" *Indique un correo electrónico válido.\n";var q=" *Indique una teléfono de contacto.\n";var v=" *Indique un teléfono de contacto válido.\n";var k="Explique brevemente el motivo.";var t=" *Explique brevemente el motivo de la consulta.\n";var g=" *Sólo se permiten caracteres de la [a-z][A-Z].\n";break;case"en":var m="Please fill in the fields of the booking form and click Make reservation:\n\n";var a=" *Enter a contact name.\n";var o=" *Enter a valid contact name.\n";var u=" *Only characters allowed [a-z][A-Z].\n";var c=" *Enter an email address contact.\n";var h=" *Enter a valid email address.\n";var q=" *Enter a contact phone.\n";var v=" *Enter a valid contact phone.\n";var k="Explain briefly why.";var t=" *Explain briefly why.\n";var g=" *Only characters allowed [a-z][A-Z].\n";break;case"fr":var m="S'il vous plaît remplir les champs indiqués dans le formulaire de réservation et cliquez sur Effectuer\n\n";var a=" *Entrez un nom de contact.\n";var o=" *Entrez un nom de contact en cours de validité.\n";var u=" *Seuls les caractères autorisés [a-z][A-Z].\n";var c=" *Entrez une adresse de courriel.\n";var h=" *Veuillez entrer une adresse email valide.\n";var q=" *Entrez un téléphone de contact.\n";var v=" *Entrez un téléphone valide contact.\n";var k="Expliquez brievement pourquoi.";var t=" *Expliquer brièvement pourquoi.\n";var g=" *Seuls les caractères autorisés [a-z][A-Z].\n";break;default:var m="Por favor, rellene los campos indicados del formulario y pulse Realizar reservar:\n\n";var a=" *Indique un nombre de contacto.\n";var o=" *Indique un nombre de contacto válido.\n";var u=" *Sólo se permiten caracteres de la [a-z][A-Z].\n";var c=" *Indique una dirección de correo electrónico de contacto.\n";var h=" *Indique un correo electrónico válido.\n";var q=" *Indique una teléfono de contacto.\n";var v=" *Indique un teléfono de contacto válido.\n";var k="Explique brevemente el motivo.";var t=" *Explique brevemente el motivo de la consulta.\n";var g=" *Sólo se permiten caracteres de la [a-z][A-Z].\n"}if(w.length==0||w.length>40){s=s+a;r=true;document.getElementById("name").focus()}else{var d;var b=w;var n="abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ ";for(var p=0,d="",n;p<b.length;p++){if(n.indexOf(b.charAt(p))==-1){d=d+b.charAt(p);s=s+o+u;r=true;document.getElementById("name").focus();break}}}if(e.length==0){s=s+c;r=true}else{if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(e)){}else{s=s+h;r=true}}if(f.length==0){s=s+q;r=true}else{if(isNaN(f)||f.length<9){s=s+v;r=true}}if(l==k||w.length>500){s=s+t;r=true;document.getElementById("message").focus()}else{if(/^[\w\.ñ\@/\n/\s]+$/i.test(l)){}else{s=s+g;r=true;document.getElementById("message").focus()}}if(r==true){s=m+s;alert(s);return 0}else{document.contactform.submit();return false}}function vdfbt(){var F=document.getElementById("name").value;var h=document.getElementById("direcm").value;var j=document.getElementById("phone").value;var e=document.getElementById("person").value;var t=document.getElementById("allergic").value;var a=document.getElementById("smoker").value;var C=document.getElementById("theDate").value;var k=document.getElementById("hour").value;var q=document.getElementById("message").value;var o=document.getElementById("ln").value;var y=false;var z="";switch(o){case"es":var r="Por favor, rellene los campos indicados del formulario y pulse Realizar reservar:\n\n";var b=" *Indique un nombre de contacto.\n";var u=" *Indique un nombre de contacto válido.\n";var B=" *Sólo se permiten caracteres de la [a-z][A-Z].\n";var f=" *Indique una dirección de correo electrónico de contacto.\n";var m=" *Indique un correo electrónico válido.\n";var w=" *Indique una teléfono de contacto.\n";var E=" *Indique un teléfono de contacto válido.\n";var d=" *Indique el número de comensales.\n";var D=" *Indique una fecha de reserva.\n";var x=" *La fecha de reserva debe ser mayor o igual que la fecha de actual.\n";var n=" *Indique una hora aproximada para la reserva.\n";var p="Escriba los detalles importantes para que podamos atenderle mejor.";var A=" *Explique brevemente los detalles para preparar la mesa.\n";var l=" *Sólo se permiten caracteres de la [a-z][A-Z].\n";break;case"en":var r="Please fill in the fields of the booking form and click Make reservation:\n\n";var b=" *Enter a contact name.\n";var u=" *Enter a valid contact name.\n";var B=" *Only characters allowed [a-z][A-Z].\n";var f=" *Enter an email address contact.\n";var m=" *Enter a valid email address.\n";var w=" *Enter a contact phone.\n";var E=" *Enter a valid contact phone.\n";var d=" *Indicate the number of guests.\n";var D=" *Enter a reservation date.\n";var x=" *The reservation date must be greater than or equal to the current date.\n";var n=" *Indicate an approximate time for booking.\n";var p="Enter the relevant details so we can serve you better.";var A=" *Briefly explain the details to set the table.\n";var l=" *Only characters allowed [a-z][A-Z].\n";break;case"fr":var r="S'il vous plaît remplir les champs indiqués dans le formulaire de réservation et cliquez sur Effectuer\n\n";var b=" *Entrez un nom de contact.\n";var u=" *Entrez un nom de contact en cours de validité.\n";var B=" *Seuls les caractères autorisés [a-z][A-Z].\n";var f=" *Entrez une adresse de courriel.\n";var m=" *Veuillez entrer une adresse email valide.\n";var w=" *Entrez un téléphone de contact.\n";var E=" *Entrez un téléphone valide contact.\n";var d=" *Indiquez le nombre de clients.\n";var D=" *S'il vous plaît réserver une date.\n";var x=" *La date de réservation doit être supérieure ou égale à la date actuelle.\n";var n=" *Indiquez une date approximative pour la réservation.\n";var p="Entrez les détails pertinents afin que nous puissions mieux vous servir.";var A=" *Expliquer brièvement les détails de mettre la table.\n";var l=" *Seuls les caractères autorisés [a-z][A-Z].\n";break;default:var r="Por favor, rellene los campos indicados del formulario y pulse Realizar reservar:\n\n";var b=" *Indique un nombre de contacto.\n";var u=" *Indique un nombre de contacto válido.\n";var B=" *Sólo se permiten caracteres de la [a-z][A-Z].\n";var f=" *Indique una dirección de correo electrónico de contacto.\n";var m=" *Indique un correo electrónico válido.\n";var w=" *Indique una teléfono de contacto.\n";var E=" *Indique un teléfono de contacto válido.\n";var d=" *Indique el número de comensales.\n";var D=" *Indique una fecha de reserva.\n";var x=" *La fecha de reserva debe ser mayor o igual que la fecha de actual.\n";var n=" *Indique una hora aproximada para la reserva.\n";var p="Escriba los detalles importantes para que podamos atenderle mejor.";var A=" *Explique brevemente los detalles para preparar la mesa.\n";var l=" *Sólo se permiten caracteres de la [a-z][A-Z].\n"}if(F.length==0||F.length>28){z=z+b;y=true;document.getElementById("name").focus()}else{var g;var c=F;var s="abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ ";for(var v=0,g="",s;v<c.length;v++){if(s.indexOf(c.charAt(v))==-1){g=g+c.charAt(v);z=z+u+B;y=true;document.getElementById("name").focus();break}}}if(h.length==0){z=z+f;y=true}else{if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(h)){}else{z=z+m;y=true}}if(j.length==0){z=z+w;y=true}else{if(isNaN(j)||j.length<9){z=z+E;y=true}}if(e=="-1"||e>11){z=z+d;y=true}if(q==p||F.length>500){z=z+A;y=true;document.getElementById("message").focus()}else{if(/^[\w\.ñ\@/\n/\s]+$/i.test(q)){}else{z=z+l;y=true;document.getElementById("message").focus()}}if(y==true){z=r+z;alert(z);exit}else{document.contactform.submit();return false}exit}function lfmb(){var c=new Date();var a=new Date();a.setTime(a.getTime()+24*60*60*1000);var j=c.getDate();var i=c.getMonth()+1;var h=c.getFullYear();var f=a.getDate();var g=a.getMonth()+1;var e=a.getFullYear();if(j<10){j="0"+j}if(i<10){i="0"+i}if(f<10){f="0"+f}if(g<10){g="0"+g}var b=(j+"/"+i+"/"+h);var d=(f+"/"+g+"/"+e);document.forms[0]["theDate"].value=b;document.forms[0]["theDate2"].value=d;document.forms[0]["cat"].value="DOB";document.forms[0]["norooms"].value="01";document.forms[0]["nopax"].value="02"}function vali(){var h=document.getElementById("theDate").value;var b=document.getElementById("theDate2").value;var g=document.getElementById("hnr").value;var a=document.getElementById("cat").value;var c=document.getElementById("norooms").value;var f=document.getElementById("nopax").value;var e=document.getElementById("ln").value;var d=new Array(2);var d=dater(h,b,e);if(d[0]==true){alert(d[1]);exit}else{que(h,b,g,a,c,f,e)}}function dater(u,e,h){var d=true;var s=new Array(2);switch(h){case"es":var i="Por favor, revise los datos indicados de su reserva:\n\n";var t="";var p=" *Llegada: La fecha de llegada debe ser posterior o igual a la fecha actual.\n";var o=" *Salida: La fecha de salida debe ser posterior a la fecha de llegada.\n";s[1]=i;var l=getDayCal(u);var g=getMonthCal(u);var m=getYYCal(u);var c=getDayCal(e);var q=getMonthCal(e);var v=getYYCal(e);var r=new Date();var j=r.getDate();var b=r.getMonth()+1;var f=r.getFullYear();var k=new Date(f,(b-1),j);var n=new Date(m,(g-1),l);var a=new Date(v,(q-1),c);if(n<k){s[0]=d;s[1]=s[1]+p}if(a<=n){s[0]=d;s[1]=s[1]+o}return s;break;case"en":var i="Please review the information listed in your reservation:\n\n";var t="";var p=" *Check-in: The arrival date should be later or equal to the current date.\n";var o=" *Check-out: Departure date must be after the date of arrival.\n";s[1]=i;var l=getDayCal(u);var g=getMonthCal(u);var m=getYYCal(u);var c=getDayCal(e);var q=getMonthCal(e);var v=getYYCal(e);var r=new Date();var j=r.getDate();var b=r.getMonth()+1;var f=r.getFullYear();var k=new Date(f,(b-1),j);var n=new Date(m,(g-1),l);var a=new Date(v,(q-1),c);if(n<k){s[0]=d;s[1]=s[1]+p}if(a<=n){s[0]=d;s[1]=s[1]+o}return s;break;case"fr":var i="S'il vous plaît examiner les renseignements figurant dans votre réservation:\n\n";var t="";var p=" *Arrivée: La date d'arrivée doit être supérieure ou égale à la date du jour.\n";var o=" *Départ: Date de départ doit être postérieure à la date d'arrivée.\n";s[1]=i;var l=getDayCal(u);var g=getMonthCal(u);var m=getYYCal(u);var c=getDayCal(e);var q=getMonthCal(e);var v=getYYCal(e);var r=new Date();var j=r.getDate();var b=r.getMonth()+1;var f=r.getFullYear();var k=new Date(f,(b-1),j);var n=new Date(m,(g-1),l);var a=new Date(v,(q-1),c);if(n<k){s[0]=d;s[1]=s[1]+p}if(a<=n){s[0]=d;s[1]=s[1]+o}return s;break;default:return s}}function que(b,d,e,j,n,k,i){var l=getDayCal(b);var c=getMonthCal(b);var h=getYYCal(b);var m=getDayCal(d);var g=getMonthCal(d);var f=getYYCal(d);var a=locat(l,c,h,m,g,f,n,e,j,k,i);return true}function getDayCal(a){var b=a.substring(0,2);return b}function getMonthCal(a){var b=a.substring(3,5);return b}function getYYCal(a){var b=a.substring(6,10);return b}function locat(f,e,b,l,k,c,a,d,h,j,g){var i="https://mysihot.com/SIHOTWeb/indexInFrame.htm?HN="+d+"&FSLINK=0&FSTITLE=0&NOPAX="+j+"&NOROOMS="+a+"&CAT="+h+"&ARR="+b+"-"+e+"-"+f+"&DEP="+c+"-"+k+"-"+l+"&LN="+g+"&FSLINK=0&FSTITLE=0&SHOWPRICES=Y";mefa(i,g)}ini="info";middle="hotelmoderno";end="bcn.com";simbol="@";function getDirec(){return ini+simbol+middle+end}function writeDirect(){document.write("<a href='mailto:"+getDirec()+"' rel='nofollow'>"+getDirec()+"</a>")}function tagsIframe(a){var b="Close";switch(a){case"es":b="Cerrar";break;case"en":b="Close";break;case"fr":b="Fermer";break;default:b="Close"}return b}function sifrme(b,d,c){document.getElementById("inputerrors").value=c;var a=tagsIframe(d);div=document.getElementById("ifw2");div.innerHTML+='<div style="position:absolute; width:100%; background-color: #352c27;" align="right"><a href="#" onclick="closeIframe()">'+a;+"</a></div>";div.innerHTML+='<br /><iframe id="xx" src="'+b+'" width="620" height="200" name="web" style="background-color: #FFFFFF"></iframe>';div.style.visibility="visible";document.getElementById("pic2").style.visibility="visible";disabledElementsFormBook()}function mefa(c,b){var a=tagsIframe(b);div=document.getElementById("ifw");div.innerHTML+='<div style="position:absolute; width:100%; background-color: #352c27;" align="right"><a href="#" onclick="closeIframe()">'+a;+"</a></div>";div.innerHTML+='<br /><iframe id="xx" src="'+c+'" width="756" height="502" name="web" style="background-color: #ffffff;"></iframe>';div.style.visibility="visible";document.getElementById("pic").style.visibility="visible";disabledElementsFormBook()}function disabledElementsFormBook(){document.getElementById("btn_book").disabled="disabled";document.getElementById("theDate").disabled="disabled";document.getElementById("theDate2").disabled="disabled";document.getElementById("cat").disabled="disabled";document.getElementById("norooms").disabled="disabled";document.getElementById("nopax").disabled="disabled"}function closeIframe(){document.getElementById("ifw").style.visibility="hidden";document.getElementById("ifw").innerHTML="";document.getElementById("pic").style.visibility="hidden";document.getElementById("btn_book").disabled=false;document.getElementById("theDate").disabled=false;document.getElementById("theDate2").disabled=false;document.getElementById("cat").disabled=false;document.getElementById("norooms").disabled=false;document.getElementById("nopax").disabled=false};function validateBookLit(){var g=document.getElementById("theDate").value;var a=document.getElementById("theDate2").value;var f=document.getElementById("hnr").value;var d=document.getElementById("ln").value;var b=document.getElementById("norooms").value;var e=document.getElementById("nopax").value;var c=new Array(2);var c=getDateError(g,a,d);if(c[0]==true){alert(c[1]);exit}else{newSearchLit(g,a,f,b,e,d)}}function newSearchLit(b,d,e,m,j,i){var k=getDayCal(b);var c=getMonthCal(b);var h=getYYCal(b);var l=getDayCal(d);var g=getMonthCal(d);var f=getYYCal(d);var a=ownerUrlLit(k,c,h,l,g,f,m,j,e,i);return true}function ownerUrlLit(j,b,g,k,e,d,l,i,c,f){var h="IN,DOM,DOB,TRI,CUA";var a="https://mysihot.com/SIHOTWeb/indexInFrame.htm?HN="+c+"&FSLINK=0&FSTITLE=0&NOPAX="+i+"&NOROOMS="+l+"&CAT="+h+"&ARR="+g+"-"+b+"-"+j+"&DEP="+d+"-"+e+"-"+k+"&LN="+f+"&FSLINK=0&FSTITLE=0&SHOWPRICES=Y";showIframe(a,f)};

