/* * Octorate srl - All rights reserved * form.js */ "undefined"==typeof octorate&&(octorate={}),void 0===octorate.octobook&&(octorate.octobook={}),void 0===octorate.octobook.Widget&&(octorate.octobook.Widget=function(){},octorate.octobook.Widget.running=!1,octorate.octobook.Widget.jq=null,octorate.octobook.Widget.script=function(t,e,o){var a=void 0!==o;if(!t){var n=document.createElement("script");return n.type="text/javascript",n.src=e,a&&(n.onload=o,n.onreadystatechange=function(){"complete"!==this.readyState&&"loaded"!==this.readyState||(n.onreadystatechange=null,o())}),document.body.appendChild(n),!0}return a&&o(),!1},octorate.octobook.Widget.getSetting=function(t){var e=window.octorateSettings;return e?e[t]:null},octorate.octobook.Widget.load=function(){var t=octorate.octobook.Widget;t.running=!0,t.running&&(window.addEventListener?window.addEventListener("load",t.show):window.attachEvent&&window.attachEvent("onload",t.show))},octorate.octobook.Widget.show=function(){for(var t=new RegExp("/octobook/resources/widget/js/(form(\\.full)?\\.js)$"),e=document.getElementsByTagName("script"),o=[],a="",n=0;n0&&(o.push(r),""===a&&(a=r.src.replace(i[1],"jquery.js")))}if(o.length<=0){t=new RegExp("https?://((www.)?(bbliverate|octorate|localhost)(.com)?)/inject/widget.js\\?cid=([0-9a-z]+)");for(n=0;n0&&(o.push(r),r.setAttribute("data-sitekey",i[5]),""===a&&(a="https://"+i[1]+"/octobook/resources/widget/js/jquery.js"))}}var c=octorate.octobook.Widget;c.script(!1,a,function(){c.pop(o)})},octorate.octobook.Widget.append=function(t,e){1===t.parents("head:eq(0)").length?document.body.appendChild(e):t.after(e)},octorate.octobook.Widget.pop=function(t){var e=octorate.octobook.Widget;if(t.length>0){var o=e.jq(t.pop()),a=o.attr("src"),n=o.attr("src").indexOf("/resources/");a=n>=0?a.substring(0,n):a.substring(0,o.attr("src").indexOf("/inject/"))+"/octobook";var r=o.attr("data-sitekey");if(void 0===r||null===r||""===r){var i=e.getParameterByName("octobooksearch");if(null!==i&&""!==i){var c=document.getElementById("octoframe");void 0!==c&&null!==c||((c=document.createElement("iframe")).setAttribute("id","octoframe"),c.setAttribute("class","octoframe"),e.append(o,c)),void 0!==c.src&&null!==c.src&&""!==c.src||(c.src=a+"/site/reservation/result.xhtml?"+i)}return void e.pop(t)}var d=o.attr("data-container"),s=null;if(void 0===d||""===d)s=document.createElement("div"),e.append(o,s);else{if(0===(s=e.jq("#"+d)).length)return;s=s[0]}var l=o.attr("data-lang");l=void 0!==l?"&lang="+l:"",s.setAttribute("data-sitekey",r),e.jq.get(a+"/site/widget/form.xhtml?sitekey="+r+l,function(o){e.jq(s).html(o),e.form(a,s),e.pop(t)})}else e.running=!1},octorate.octobook.Widget.getParameterByName=function(t){var e=window.location.href;t=t.replace(/[\[\]]/g,"\\$&");var o=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);return o?o[2]?decodeURIComponent(o[2].replace(/\+/g," ")):"":null},octorate.octobook.Widget.form=function(t,e){var o=octorate.octobook.Widget,a=o.jq(".octobook",e),n=o.jq(".octobookcheckin input",e),r=o.jq(".octobookcheckout input",e),i=o.jq("form",e),c=i.find("input[name=lang]").val();"octopopup"===i.attr("target")?i.submit(function(){var t=Math.min(window.innerWidth,800),e=Math.min(window.innerHeight,600);window.open("about:blank","octopopup","toolbar=0,scrollbars=1,location=no,statusbar=0,menubar=0,resizable=0,width="+t+",height="+e)}):"octoframe"===i.attr("target")?i.submit(function(){var e=Math.min(window.innerWidth,800),o=Math.min(window.innerHeight-40,600),a=document.createElement("img");a.src=t+"/resources/atlas-layout/images/delete-white.svg",a.style.position="fixed",a.style.zIndex="1000",a.style.top="2px",a.style.right="2px",a.style.cursor="pointer",a.style.width="32px",a.style.height="32px",a.onclick=function(){document.body.removeChild(a),document.body.removeChild(r),document.body.removeChild(n)};var n=document.createElement("div");n.style.position="fixed",n.style.zIndex="1000",n.style.top="0",n.style.left="0",n.style.right="0",n.style.bottom="0",n.style.backgroundColor="rgba(50,50,50,0.8)";var r=document.createElement("iframe");r.style.position="fixed",r.style.zIndex="1000",r.style.top=36+Math.max(0,(window.innerHeight-36-o)/2)+"px",r.style.left=Math.max(0,(window.innerWidth-e)/2)+"px",r.style.width=e+"px",r.style.height=o+"px",r.style.border="1px solid #666",r.style.boxShadow="0 0 10px #333",r.name="octoframe",document.body.appendChild(n),document.body.appendChild(r),document.body.appendChild(a)}):"true"===i.attr("data-serialize")&&i.submit(function(){var t=i.attr("action"),e=i.serialize();return window.location=t+(t.indexOf("?")>-1?"&":"?")+"octobooksearch="+encodeURIComponent(e),!1});var d=a.attr("data-dateformat"),s=a.attr("data-accomodation"),l=parseInt(n.attr("data-advance")),u=parseInt(r.attr("data-minstay"));o.script("undefined"!=typeof octorateAvailCalendar,t+"/rest/reservation/calendar/"+s),octorateAvailCalendar={};var m=new Date;m.setMonth(m.getMonth()+24),m.setDate(1),m.setHours(0),m.setMinutes(0),m.setSeconds(0),m.setMilliseconds(0);var p=new Date;p.setHours(0),p.setMinutes(0),p.setSeconds(0),p.setMilliseconds(0),p.setDate(p.getDate()+l);var h={dateFormat:d,beforeShowDay:function(t){return t=m?[!1,""]:[!0,0===octorateAvailCalendar[t.getTime()/1e3]?"closed":""]}},g=octorate.octobook.i18n;void 0!==g&&void 0!==g[c]&&(h.monthNames=g[c].monthNames,h.monthNamesShort=g[c].monthNamesShort,h.dayNames=g[c].dayNames,h.dayNamesShort=g[c].dayNamesShort,h.dayNamesMin=g[c].dayNamesShort,h.firstDay=g[c].firstDay);var f=function(){var t=n.datepicker("getDate"),e=r.datepicker("getDate");t
Copyright Hotel B&B Bergzicht 2018
Hotel B&B Bergzicht