!function(){var f,u={optionsString:"hotel-1-186869-de_DE-m-b-1-1-0-3-0",containerId:"#holidaycheck-widget-hotel-1-186869-de_DE-m-b-1-1-0-3-0",jQueryUrl:"https://www.holidaycheck.de/assets/classic/js/jquery.min.js",cssUrl:"https://www.holidaycheck.de/widgets/widgets.min.css?v=1634797032",fontUrl:"https://www.holidaycheck.de/promo/css/font-opensans.css?src=admin&v=1634797032",ajaxCallUrl:"https://www.holidaycheck.de/widgets?step=code&type=callback&options=hotel-1-186869-de_DE-m-b-1-1-0-3-0",apiUrl:"https://www.holidaycheck.de/widgets?step=addReview"};void 0===self.jQuery||!jQuery.fn||!jQuery.fn.jquery||parseFloat(jQuery.fn.jquery)<1.8?function(e,t){var a=document.createElement("script");a.src=e;var e=document.getElementsByTagName("head")[0]||document.documentElement,n=!1;a.onload=a.onreadystatechange=function(){n||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(n=!0,t(),a.onload=a.onreadystatechange=null)},e.appendChild(a)}(u.jQueryUrl,function(){void 0===self.jQuery?window.console&&console.error&&console.error("failed to load jQuery"):(f=self.jQuery.noConflict(!0),e())}):(f=self.jQuery,e());var p=null;function m(){return p=($popup||f(document)).find("#hc-review-form")}function n(e,t){var a=0;switch(e){case"s":a=t.parent().width()-4;break;case"m":a=t.parent().parent().width()-t.parent().find("a.hc-widget-home-link").outerWidth()-16-5}t.outerWidth()>a&&t.addClass("hc-widget-multiline")}function e(){f(document).ready(function(){0==f("#holidaycheck_widget_font").length&&f("head").append('<link rel="stylesheet" type="text/css" id="holidaycheck_widget_font" href="'+u.fontUrl+'" />'),0==f("#holidaycheck_widget_css").length&&f("head").append('<link rel="stylesheet" type="text/css" id="holidaycheck_widget_css" href="'+u.cssUrl+'" />'),f.ajax({url:u.ajaxCallUrl,cache:!1,dataType:"jsonp",success:function(e,t){var a=f(u.containerId);a.html(e.content);e=a.find(".hc-widget-small .hc-widget-hotel-name");e.length?n("s",e):(e=a.find(".hc-widget-medium .hc-widget-name-wrapper")).length&&n("m",e),0<a.find("a.hc-widget-cta").length&&function(){f("body > #hc-widget-popup-"+u.optionsString).remove();var t=f("#hc-widget-popup-"+u.optionsString),a=f(".hc-widget-"+u.optionsString+" .hc-widget-cta");t.appendTo("body"),p=t.find("#hc-review-form");for(var n=["title","text","recommend","rate","name","age","city","country","duration","month","year","peoplecount","children","purpose","email","repeatemail"],i=["title","name","city","email","repeatemail"],c=[],e=0;e<n.length;e++){var r=p.find(".hc-review_"+n[e]);if(r.length){switch(n[e]){case"title":v(r,p.find(".hc-title-counter .hc-counter-value"),r.data("max"));break;case"text":v(r,p.find(".hc-text-counter .hc-counter-value"),r.data("max"))}c[e]=r.val()}}p.find(".hc-button-abort").add(t.find(".hc-popup-close")).click(function(e){e.preventDefault(),t.fadeOut(400,function(){p.css({marginLeft:0});for(var e=0;e<n.length;e++)p.find(".hc-review_"+n[e]).val(c[e]);p.find(".button-recommend").removeClass("active"),p.find(".button-rate").removeClass("active");for(e=0;e<i.length;e++)p.find(".hc-review_"+i[e]).data("clicked","notClicked")})}),a.on("click",function(e){e.preventDefault(),a.parents(".widgetPreviewDisableLinks").length||t.fadeIn({complete:function(){f("html, body").animate({scrollTop:"0px"},700),y(),g(1)}})}),p.find("input.hc-review_title").focus(function(){"clicked"!=f(this).data("clicked")&&(f(this).val(""),f(this).data("clicked","clicked"))}),p.find("input.hc-review_name").focus(function(){"clicked"!=f(this).data("clicked")&&(f(this).val(""),f(this).data("clicked","clicked"))}),p.find("input.hc-review_city").focus(function(){"clicked"!=f(this).data("clicked")&&(f(this).val(""),f(this).data("clicked","clicked"))}),p.find("input.hc-review_email").focus(function(){"clicked"!=f(this).data("clicked")&&(f(this).val(""),f(this).data("clicked","clicked"))}),p.find("input.hc-review_repeatemail").focus(function(){"clicked"!=f(this).data("clicked")&&(f(this).val(""),f(this).data("clicked","clicked"))});var d=new Date,o=d.getFullYear(),l=d.getMonth()+1,s=p.find(".hc-review_month"),h=s.html();p.find(".hc-review_year").on("change",function(){s.html(h),o==f(this).val()&&s.find("option").each(function(e){f(this).val()>l&&f(this).remove()})}),p.find(".button-recommend").click(function(){p.find(".button-recommend").removeClass("active"),f(this).addClass("active"),p.find("input."+f(this).data("target")).val(f(this).data("value")),p.find(".hc-validate-"+f(this).data("target")).hide()}),p.find(".button-rate").click(function(){p.find(".button-rate").removeClass("active");var e=f(this).index();p.find(".button-rate").each(function(){f(this).index()<=e&&f(this).addClass("active")}),p.find(".hc-validate-"+f(this).data("target")).hide(),p.find(".hc-rate-description").html(f(this).data("description")),p.find("input."+f(this).data("target")).val(f(this).data("value"))}),p.find(".hc-firstpage .hc-button-next").click(function(e){var n;e.preventDefault(),e.stopPropagation(),n=!1,(p||m()).find(".hc-firstpage *[data-validate=true]").each(function(){var e=f(this),t=e.val(),a=!1;switch(e.data("ruleset")){case"minmax":"clicked"!==e.data("clicked")?a=!1:t.length>=parseInt(e.data("min"),10)&&t.length<=parseInt(e.data("max"),10)&&(a=!0);break;case"numeric":parseInt(t)==t&&parseInt(t,10)>=parseInt(e.data("min"),10)&&parseInt(t,10)<=parseInt(e.data("max"),10)&&(a=!0)}a?p.find(".hc-validate-"+e.attr("class")).hide():(n=!0,p.find(".hc-validate-"+e.attr("class")).show())}),n||g(2)}),p.find(".hc-secondpage .hc-button-next").click(function(e){var n,i,c;e.preventDefault(),e.stopPropagation(),c=!1,(p||m()).find(".hc-secondpage *[data-validate=true]").each(function(){var e=f(this),t=e.val(),a=!1;switch(e.data("ruleset")){case"minmax":"clicked"!==e.data("clicked")?a=!1:t.length>=parseInt(e.data("min"),10)&&t.length<=parseInt(e.data("max"),10)&&(a=!0);break;case"between":""!=t&&t>=parseInt(e.data("min"),10)&&t<=parseInt(e.data("max"),10)&&(a=!0);break;case"numeric":parseInt(t,10)==t&&parseInt(t,10)>=parseInt(e.data("min"),10)&&parseInt(t,10)<=parseInt(e.data("max"),10)&&(a=!0);break;case"email":/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)&&(a=!0);break;case"repeat":t==p.find("input."+e.data("repeat")).val()&&(a=!0);break;case"checked":e.is(":checked")&&(a=!0)}a?p.find(".hc-validate-"+e.attr("class")).hide():(c=!0,p.find(".hc-validate-"+e.attr("class")).show())}),c||(n=["title","text","recommend","rate"],i=(p||m()).find(".hc-spinner"),f.ajax({url:u.apiUrl,dataType:"jsonp",data:{content:(p||m()).serialize()},beforeSend:function(){i.show()},success:function(e){if(i.hide(),e.result)g(3);else if("invalidData"===e.data.type){var t,a=!1;for(t in e.data.errorMessages)e.data.errorMessages.hasOwnProperty(t)&&(0<=n.indexOf(t)&&(a=!0),("termsofuse"==t?(p||m()).find("*[name='"+t+"']").parent().next():(p||m()).find("*[name='"+t+"']").parent()).find(".hc-validate").html(e.data.errorMessages[t][0]).show());g(a?1:2)}}}))}),p.find(".hc-secondpage .hc-button-previous").click(function(e){e.preventDefault(),e.stopPropagation(),g(1)}),window.addEventListener("resize",function(){y();var e=p[0].getAttribute("data-num");0<e&&w(e*-k())})}();e=jQuery(".hc-widget");e.length&&(e=e[0])&&(a=e.parentNode.offsetWidth,e.offsetWidth>a&&f(e).css({width:a-5}).addClass("hc-squeeze"))},error:function(e,t,a){window.console&&console.error&&console.error("HolidayCheck Widget Error: %o",arguments)}})})}function v(t,a,n){t.keyup(function(){var e=f(this).val().length;n<e&&(t.val(t.val().substring(0,n)),e=n),a.html(e)})}function g(e){var t="",a="";switch(e){case 1:a=".hc-secondpage, .hc-finalpage",t=".hc-firstpage";break;case 2:a=".hc-firstpage, .hc-finalpage",t=".hc-secondpage";break;case 3:a=".hc-firstpage, .hc-secondpage",t=".hc-finalpage"}for(var n=p[0].querySelectorAll(a),i=0;i<n.length;i++)n[i].style.height="1px";document.getElementById("hc-popup").scrollTo({top:0,behavior:"smooth"}),p[0].querySelector(t).style.height="";var c=(e-1)*-k(),r=p||m();r&&(r[0].setAttribute("data-num",e-1),r.animate({marginLeft:c+"px"},{duration:600,complete:function(){w(c)}}))}function k(){return p.closest("#hc-popup")[0].offsetWidth}function y(){var e=k();p[0].style.width=3*e+"px";for(var t=p[0].querySelectorAll(".hc-pcontent"),a=0;a<t.length;a++)t[a].style.width=e+"px"}function w(e){p[0].style.setProperty("margin-left",e+"px","important")}"function"!=typeof self.gaOnclickCount&&(self.gaOnclickCount=function(){})}();