var unitInlineApi={aSubModule:['request','booking'],setOffset:function(){return-30},oLastOpenClose:{},lVersion:1,lIconsVersion:1,init:function(){if($('div.unitinlineapi').attr('data-iconsversion')>0){this.lIconsVersion=$('div.unitinlineapi').attr('data-iconsversion')}$.each(this.aSubModule,$.proxy(function(i,sModule){if(this[sModule]!=undefined&&this[sModule].init!=undefined){this[sModule].init()}},this))},openClose:function(oThis,sId,options){options=$.extend({sGroupKey:'',onOpen:function(){}},options||{});if(this.oLastOpenClose[options.sGroupKey]!=undefined&&options.sGroupKey!=''){if(this.oLastOpenClose[options.sGroupKey].element!=$('#'+sId)){this.oLastOpenClose[options.sGroupKey].element.addClass('closed');this.oLastOpenClose[sKey].btn.removeClass('btnopen');this.oLastOpenClose[sKey].btn.addClass('btnclose')}}if($('#'+sId).hasClass('closed')){$('#'+sId).removeClass('closed');$(oThis).removeClass('btnclose');$(oThis).addClass('btnopen');var oSvg=$(oThis).find('svg.openclose');if(oSvg.length>0){var oSvgUse=oSvg.find('use');oSvg.removeClass('icon-down');oSvg.addClass('icon-up');oSvgUse.attr("xlink:href","#icon-up")}this.oLastOpenClose[options.sGroupKey]={element:$('#'+sId),btn:$(oThis)};options.onOpen(oThis,$('#'+sId))}else{$('#'+sId).addClass('closed');$(oThis).removeClass('btnopen');$(oThis).addClass('btnclose');var oSvg=$(oThis).find('svg.openclose');if(oSvg.length>0){var oSvgUse=oSvg.find('use');oSvg.removeClass('icon-up');oSvg.addClass('icon-down');oSvgUse.attr("xlink:href","#icon-down")}this.oLastOpenClose[options.sGroupKey]=undefined}},scrollToFormError:function(sFormName){var oErrorElement=$('#'+sFormName).find('.errorV1').first();if(oErrorElement&&typeof(oErrorElement.length)!='undefined'&&oErrorElement.length==0)oErrorElement=undefined;if(!oErrorElement)oErrorElement=$('#'+sFormName).find('.error').first();if(!oErrorElement.is(':visible')&&oErrorElement.closest('div.addressdata').length){this.showHideElement(oErrorElement.closest('div.addressdata').prev('a.childrenbox'),sFormName,'addressdata')}var lOffset=this.setOffset(oErrorElement);if(!$.isNumeric(lOffset)){lOffset=0}$('body, html').animate({scrollTop:oErrorElement.offset().top+lOffset})},showHideElement:function(oThis,sFormName,sId){if(!$('#'+sId).is(':visible')){$('#'+sId).show()}else{$('#'+sId).hide()}},postToPage:function(sPageKey,options){options=$.extend({sFormId:'BpDataForm',sFormAction:'',oPost:{}},options||{});var oForm=$('#'+options.sFormId);oForm=oForm[0];if(oForm==undefined){return}if(options.sFormAction!=''){$(oForm).attr('action',options.sFormAction)}$(oForm.sPageKey).val(sPageKey);for(var key in options.oPost){$(oForm[key]).val(options.oPost[key])}window.setTimeout(function(){oForm.submit()},500)}};onScrMngrLoaded(function(){$(document).ready(function(){unitInlineApi.init()})});unitInlineApi.request={bLock:false,aRoomResizer:[],lVisibleRooms:1,lMaxVisibleRooms:3,bRoomCloseEventBinded:false,lLastOpenedRoomIndex:undefined,aRoomPreviewParams:'',sFormId:'',init:function(){this.lMaxVisibleRooms=$('div.unitinlineapi.request div.requestdata div.roomtypebox').length},showChild:function(oThis,sFormName,sId){if(!$('#'+sId).is(':visible')){$('#'+sId).show();$(oThis).hide()}},openCloseForm:function(oThis,sFormName,sId,options){var aTemp=[];if($.type(sId)=='object'){aTemp=sId}else{aTemp=$('#'+sId)}aTemp.each(function(lIndex,oElement){oElement=$(oElement);if(!oElement.hasClass('closed')){var oRoomIcon=$('#roomicon');oRoomIcon.addClass('icon-add-room');oRoomIcon.removeClass('icon-remove-room');var oRoomIconUse=oRoomIcon.find('use');$(oRoomIconUse).attr('xlink:href','#icon-add-room');oElement.find('input').val('');oElement.find('select').each(function(lIndex,oSelect){$(oSelect).val('');$(oSelect).next('span.select').html(oSelect.options[0].innerHTML)})}else{var oRoomIcon=$('#roomicon');oRoomIcon.addClass('icon-remove-room');oRoomIcon.removeClass('icon-add-room');var oRoomIconUse=oRoomIcon.find('use');$(oRoomIconUse).attr('xlink:href','#icon-remove-room')}});if($.type(sId)=='object'){this.openCloseArray(oThis,sId)}else{unitInlineApi.openClose(oThis,sId,options)}eval(sFormName).generateIcons({'sFormName':sFormName})},openCloseArray:function(oThis,aElements){$(oThis).toggleClass('btnclose');$(oThis).toggleClass('btnopen');aElements.each(function(lIndex,oElement){$(oElement).toggleClass('closed')})},toggleChildAgeBox:function(sSelectId,lBox){if($('#unitinlineapiChildrenAgeBox'+lBox).hasClass('open')){$('#unitinlineapiChildrenAgeBox'+lBox).toggleClass('open')}else{this.openCloseChildAgeBox(sSelectId,lBox)}},openCloseChildAgeBox:function(sSelectId,lBox){var oSelect=$('#'+sSelectId);var oAgeBox=$('#unitinlineapiChildrenAgeBox'+lBox);var oEditButton=$('#unitinlineapiEditButton');oAgeBox.removeClass('open');$('div.row.select',oAgeBox).hide();if(oSelect.val()>0){oEditButton.show();for(var i=0;i<oSelect.val();i++){$('div.row.select',oAgeBox).eq(i).show()}oAgeBox.addClass('open')}else{oEditButton.hide()}},toggleRoomSelect:function(sFormName,lIndex){if(this.bLock)return;this.bLock=true;if($('#'+sFormName+'rooms'+lIndex).hasClass('open')){$('#'+sFormName+'rooms'+lIndex).removeClass('open');this.unbindRoomCloseEvent(sFormName,lIndex);this.lLastOpenedRoomIndex=undefined}else{$('#'+sFormName+'rooms'+lIndex).addClass('open');if(this.bRoomCloseEventBinded){this.unbindRoomCloseEvent(sFormName,this.lLastOpenedRoomIndex);this.lLastOpenedRoomIndex=undefined}this.bindRoomCloseEvent(sFormName,lIndex);var oResize=this.aRoomResizer[lIndex];if(oResize!=undefined){oResize.resize()}else{oResize=$.boxResizer('#'+sFormName+'rooms'+lIndex+' div.inside div.room',{bGrid:true,lMinWidth:620})}window[sFormName].remove(window[sFormName+'Data'],$('#'+sFormName+'RoomSelectID'+lIndex))}window.setTimeout(function(){this.bLock=false}.bind(this),150)},bindRoomCloseEvent:function(sFormName,lIndex){if(!this.bRoomCloseEventBinded){this.bRoomCloseEventBinded=true;this.lLastOpenedRoomIndex=lIndex;$(window).on('click.RoomListToggleT1',function(oEvent){var bContains=$.contains($('div.unitinlineapi.request div.requestdata div.formcontent div.customselect#'+sFormName+'rooms'+lIndex)[0],oEvent.target);if(!bContains){this.unbindRoomCloseEvent(sFormName,lIndex)}}.bind(this))}},unbindRoomCloseEvent:function(sFormName,lIndex){if(this.bRoomCloseEventBinded){this.bRoomCloseEventBinded=false;$(window).off('click.RoomListToggleT1');if(sFormName!=undefined&&lIndex!=undefined){this.toggleRoomSelect(sFormName,lIndex)}}},setRoomId:function(sRoomId,sFormName,lIndex){var sCustomSelectId=sFormName+'rooms'+lIndex;if($('#'+sCustomSelectId+' div.rooms div.room').length){$('#'+sCustomSelectId+' div.rooms div.room').removeClass('activebg active-room');if($('#'+sFormName+'lRoomID'+lIndex).length){$('#'+sFormName+'lRoomID'+lIndex).val(sRoomId)}if($('#'+sCustomSelectId+' div.rooms div.room[data-lRoomID="'+sRoomId+'"]').length){$('#'+sCustomSelectId+' div.rooms div.room[data-lRoomID="'+sRoomId+'"]').addClass('activebg active-room');$('#'+sCustomSelectId+' div.selectfield span.select').html($('#'+sCustomSelectId+' div.room[data-lRoomID="'+sRoomId+'"] [data-roomname]').html());if(sRoomId!=''){if($('#room'+lIndex+'preview').length){$('#room'+lIndex+'preview').show();var oRoom=$('#'+sCustomSelectId+' div.rooms div.room[data-lRoomID="'+sRoomId+'"]');$('#room'+lIndex+'preview [data-roomimage]').html(oRoom.find('div[data-roomimage]').html());$('#room'+lIndex+'preview [data-roomnamesize]').html(oRoom.find('div.roomname span[data-roomname]').html()+(oRoom.find('div.size span[data-roomsize]').html()!=''?' - '+oRoom.find('div.size span[data-roomsize]').html():''));$('#room'+lIndex+'preview [data-roompriceinfotext]').html(oRoom.find('div.priceinfotext span[data-roompriceinfotext]').html());$('#room'+lIndex+'preview').attr('data-lroomid',oRoom.attr('data-lroomid'));$('#room'+lIndex+'preview').attr('data-person',oRoom.attr('data-person'));$('#room'+lIndex+'preview').attr('data-minperson',oRoom.attr('data-minperson'));$('#room'+lIndex+'preview').attr('data-maxperson',oRoom.attr('data-maxperson'))}if($('#room'+lIndex+'preview').find('a.lightgallery0')[0]!=undefined){$('#room'+lIndex+'preview [data-roomlightbox]').closest('li').show();$('#room'+lIndex+'preview [data-roomlightbox]').attr('onclick','$(\'#room'+lIndex+'preview\').find(\'a.lightgallery0\').trigger(\'click\');')}else{$('#room'+lIndex+'preview [data-roomlightbox]').closest('li').hide()}if($('#room'+lIndex+'preview').find('a.planimage')[0]!=undefined){$('#room'+lIndex+'preview [data-roomplanlightbox]').closest('li').show();$('#room'+lIndex+'preview [data-roomplanlightbox]').attr('onclick','$(\'#room'+lIndex+'preview\').find(\'a.planimage\').trigger(\'click\');')}else{$('#room'+lIndex+'preview [data-roomplanlightbox]').closest('li').hide()}if($('#room'+lIndex+'preview').data('lightGallery')!=undefined){$('#room'+lIndex+'preview').data('lightGallery').destroy(true);initLightGallery($('#room'+lIndex+'preview'))}}else{$('#room'+lIndex+'preview').hide();$('#'+sCustomSelectId+' div.selectfield span.select').html($('#'+sCustomSelectId+' div.selectfield span.select').attr('data-defaultvalue'))}}else{$('#room'+lIndex+'preview').hide();$('#'+sCustomSelectId+' div.selectfield span.select').html($('#'+sCustomSelectId+' div.selectfield span.select').attr('data-defaultvalue'))}this.unbindRoomCloseEvent();$('#'+sCustomSelectId).removeClass('open');unitInlineApi.request.hideOccupancyWarning(lIndex)}},addRoom:function(sFormName){if(this.lVisibleRooms<=this.lMaxVisibleRooms){$('#roomtypebox'+(this.lVisibleRooms+1)).show();this.lVisibleRooms++}if(this.lVisibleRooms>1){$('#unitInlineApiRemoveRoom').show()}if(this.lVisibleRooms==this.lMaxVisibleRooms){$('#unitInlineApiAddRoom').hide()}},removeRoom:function(sFormName){this.setRoomId('',sFormName,this.lVisibleRooms);if(this.lVisibleRooms>0){$('#roomtypebox'+this.lVisibleRooms).hide();this.lVisibleRooms--}if(this.lVisibleRooms<=this.lMaxVisibleRooms){$('#unitInlineApiAddRoom').show()}if(this.lVisibleRooms==1){$('#unitInlineApiRemoveRoom').hide()}},setRoomsPerOccupancy:function(sFormName,lIndex){var updateRooms=function(){unitInlineApi.request.hideOccupancyWarning(lIndex);var lOccupants=0;if(parseInt($('#roomtypebox'+lIndex+' div.row.select.adults select').val())>0){lOccupants=parseInt($('#roomtypebox'+lIndex+' div.row.select.adults select').val())}$('#roomtypebox'+lIndex+' div.children div.row.select select').each(function(){if(parseInt($(this).val())>0){lOccupants+=1}});var lCurrentVisibleRooms=0;$('#roomtypebox'+lIndex+' div.rooms div.room').each(function(){if((lOccupants>=parseInt($(this).attr('data-minperson'))&&lOccupants<=parseInt($(this).attr('data-maxperson')))||lOccupants==parseInt($(this).attr('data-person'))||lOccupants==0){$(this).show();lCurrentVisibleRooms++}else if($(this).attr('data-minperson')==undefined&&$(this).attr('data-maxperson')==undefined&&$(this).attr('data-person')==undefined){$(this).show()}else{$(this).hide()}});if($('#'+sFormName+'lRoomID'+lIndex).val()>0){if((lOccupants<$('#room'+lIndex+'preview').attr('data-minperson')||lOccupants>$('#room'+lIndex+'preview').attr('data-maxperson'))&&lOccupants!=$('#room'+lIndex+'preview').attr('data-person')&&lOccupants!=0){$('#room'+lIndex+'preview').hide();$('#roomtypebox'+lIndex+' div.warning').show().find('div.warning-current-room').show()}else{$('#room'+lIndex+'preview').show()}}else{if(lCurrentVisibleRooms==0){$('#roomtypebox'+lIndex+' div.warning').show().find('div.warning-all-rooms').show()}}};$('#roomtypebox'+lIndex+' div.row.select.adults select, #roomtypebox'+lIndex+' div.children div.row.select select').on('change',updateRooms);updateRooms()},hideOccupancyWarning:function(lIndex){$('#roomtypebox'+lIndex+' div.warning').hide().find('div.inner-warning').hide()},countryCalling:{callingCodesData:{},countryCallingCodesData:{},oPhoneNumberField:undefined,oMobilePhoneField:undefined,oMobilePhoneCallingCode:undefined,init:function(){var oThis=this;oThis.oPhoneNumberField=$('#'+unitInlineApi.request.sFormId+'sMobilePhoneNumber');if(!oThis.oPhoneNumberField.length)return;oThis.oMobilePhoneField=$('#'+unitInlineApi.request.sFormId+'sMobilePhone');oThis.oMobilePhoneCallingCode=$('#'+unitInlineApi.request.sFormId+'sMobilePhoneCallingCode');oThis.oPhoneNumberField.on('keyup',function(evt){oThis.detectCountryByPhoneNumber($(evt.currentTarget).val());oThis.updatePhoneNumberInHiddenField()});this.oMobilePhoneCallingCode.on('change',function(evt){var callingCode=oThis.getCallingCodeFromCountryCode($(evt.currentTarget).val());oThis.updatePhoneCountrySelectField(callingCode,oThis.oPhoneNumberField.val());oThis.updatePhoneNumberInHiddenField()});this.detectCountryByPhoneNumber(this.oPhoneNumberField.val());this.oMobilePhoneCallingCode.trigger('change')},formatState:function(state){if(!state.id){return state.text}var country=unitInlineApi.request.countryCalling.countryCallingCodesData[state.element.value];var dialCode='';var countryName='';if(country!=undefined){dialCode=country['code'];countryName=country['countryName']}else{countryName=state.text}var $state=$('<span class="units-inlineapi-flag-option"><span class="units-flag units-flag-'+state.element.value+' units-flag-small units-flag-light"></span> <span class="text">'+countryName+'</span> <span class="dialCode">'+dialCode+'</span></span>');return $state},getCallingCodeFromCountryCode:function(countryCode){var value='';var country=unitInlineApi.request.countryCalling.countryCallingCodesData[countryCode];if(country!=undefined){value=country['code']+value}return value},detectCountryByPhoneNumber:function(phoneNumber){var detectCountry=false;if(phoneNumber.indexOf('+')===0){detectCountry=true}if(!detectCountry)return;var selectedCountry=null;var oThis=unitInlineApi.request.countryCalling;for(var i=1;i<=3;i++){var dialCode=phoneNumber.substr(0,i);var callingCode=oThis.callingCodesData[dialCode];if(callingCode!==undefined&&callingCode!==null){callingCode.forEach(function(o){o['areaCodes'].forEach(function(val){val=val.toString();if(val===phoneNumber.substr(i,val.length)){selectedCountry=o['countryCode']}});if(selectedCountry==null&&o['default']){selectedCountry=o['countryCode']}});oThis.updatePhoneCountrySelectField(oThis.getCallingCodeFromCountryCode(selectedCountry),phoneNumber);oThis.oMobilePhoneCallingCode.val(selectedCountry).trigger('change');break}}},updatePhoneCountrySelectField:function(newValue,phoneNumber){var oThis=unitInlineApi.request.countryCalling;var oMobilePhoneCallingCode=oThis.oMobilePhoneCallingCode;var lastCountryCallingCode=oMobilePhoneCallingCode.data('lastCountryCallingCode')||'';if(newValue!==lastCountryCallingCode&&lastCountryCallingCode!==''&&phoneNumber!==''&&phoneNumber.substr(0,lastCountryCallingCode.length)===lastCountryCallingCode){oThis.oPhoneNumberField.val(phoneNumber.replace(lastCountryCallingCode,newValue))}oMobilePhoneCallingCode.data('lastCountryCallingCode',newValue)},updatePhoneNumberInHiddenField:function(){var oThis=unitInlineApi.request.countryCalling;var value=oThis.oPhoneNumberField.val();var mobilePhoneNumber=oThis.oMobilePhoneField;if(value===''){mobilePhoneNumber.val('');return}if(value.indexOf('+')===0){mobilePhoneNumber.val(value)}else{var country=oThis.countryCallingCodesData[oThis.oMobilePhoneCallingCode.val()];if(country!=undefined){value=country['code']+value}mobilePhoneNumber.val(value)}}}};var oUnitCookies={lCookieExpires:365,init:function(){if(GetCookie('bCookieBarClosed')!='true'){if($('section.unitcookieonpage').attr('data-cookieexpires')>0){this.lCookieExpires=$('section.unitcookieonpage').attr('data-cookieexpires').toString()}$(window).on('click',$.proxy(function(oEvent){if(!$.contains($('#unitcookieonpageBar')[0],oEvent.target)){this.closeBarAndSetCookie()}},this))}},closeBarAndSetCookie:function(){$('#unitcookieonpageBar').hide();SetCookie('bCookieBarClosed','true',this.lCookieExpires)}};onScrMngrLoaded(function(){$(document).ready(function(){oUnitCookies.init()})});function initStatusBarChecker(){var oTopHelper=$('<div></div>');var oTopHelper2=$('<div></div>');var oStyleHelper=$('<style></style>');$(document.body).append(oTopHelper,oTopHelper2,oStyleHelper);oTopHelper.css({'position':'fixed','width':'100%','height':'100%','top':'0','bottom':'auto'});oTopHelper2.css({'position':'fixed','width':'100%','height':'100vh','top':'0','bottom':'auto'});function setProperty(){document.documentElement.style.setProperty('--statusbar-height',(oTopHelper2.height()-oTopHelper.height())+'px');oStyleHelper.html('@media all {\n'+'#mainmenu .mainmenu-container	{ height: calc(100vh - var(--statusbar-height)); }\n'+'}\n')}$(document).on('scroll',setProperty);setProperty()}function renderDefaultIcons(sParent){sParent=sParent==undefined?'':sParent+' ';$(sParent+"*.icon1 ul li, "+sParent+"ul.icon1 li").each(function(){var oElement=$('> svg.icon-check',this);if(oElement.length){$(oElement).html('')}else{$(this).html('<svg class="icon icon-check"><use xlink:href="#icon-check"></use></svg>'+$(this).html());oElement=$('> svg.icon-check',this)}})}function positionBreadcrumb(){var oBreadcrumb=$('#BreadcrumbT1');var oContainer=$('.breadcrumbcontainer div,div.outer-breadcrumb').first();if(oBreadcrumb.length&&oContainer.length){oContainer.append(oBreadcrumb);oContainer.parent().show();oBreadcrumb.show()}oBreadcrumb=$('[itemprop="breadcrumb"]');if(!oBreadcrumb.length)return;oContainer=$('[data-breadcrumb="true"]').first().find('[data-breadcrumb-container="true"]');if(!oContainer.length)return;oContainer.html(oBreadcrumb[0].outerHTML);oBreadcrumb.remove()}function initObjectFit(sType,oContext){oContext=oContext||document;var oObjects=$('[data-object-fit="'+sType+'"]',$(oContext));oObjects.each(function(i,o){var oPicture,oVideo,oImg;var oElement=$(o);var bUseCssObjectFit=oElement.attr('data-object-fit-css');if(bUseCssObjectFit=='true'){bUseCssObjectFit=true}else if(bUseCssObjectFit=='false'){bUseCssObjectFit=false}else{bUseCssObjectFit=undefined}if(oElement.is('img'))oElement=oElement.parent();if(oElement.data('bInitObjectFit')==true){oElement.objectFit(sType,bUseCssObjectFit)}else{oElement.data('bInitObjectFit',true);if(oElement.is('picture')||oElement.find('picture').length||oElement.is('video')||oElement.find('video').length){if(oElement.is('picture')){oPicture=oElement}else if(oElement.is('video')){oVideo=oElement}else{oPicture=oElement.find('picture');oVideo=oElement.find('video')}oPicture.each(function(){oImg=$(this).find('img');if(oImg.length){$('<img />').on('load',function(){oElement.objectFit(sType,bUseCssObjectFit)}).attr('src',oImg.attr('src'))}else{$(this).on('image:load',function(){$(this).closest('[data-object-fit="'+sType+'"]').objectFit(sType,bUseCssObjectFit)})}});oVideo.each(function(){if($(this).attr('bVideoConverted')=='true'){oElement.objectFit(sType,bUseCssObjectFit)}else{$(this).one('video:converted',$.proxy(function(){$(this).closest('[data-object-fit="'+sType+'"]').objectFit(sType,bUseCssObjectFit)},this))}})}else if(oElement.find('img').length){oElement.find('img').each(function(){$('<img />').on('load',function(){oElement.objectFit(sType,bUseCssObjectFit)}).attr('src',$(this).find('img').attr('src'))})}}})}onScrMngrLoaded(function(){$(function(){positionBreadcrumb();initObjectFit('cover');initElementLinks();agentDetection();var resizeTimer;$(window).resize(function(){clearTimeout(resizeTimer);resizeTimer=setTimeout(function(){$('[data-object-fit="cover"]').objectFit('cover')},200)});renderDefaultIcons();var aFeatures=['transition','transform'];var sPrefix;for(var i=0;i<aFeatures.length;i++){sPrefix='no';if(detectCSSFeature(aFeatures[i]))sPrefix='with';$(document.body).addClass(sPrefix+aFeatures[i])}initStatusBarChecker()})});function isSafari(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('safari')!=-1){if(ua.indexOf('chrome'))return false}return true}function agentDetection(){if(isSafari()){$('body').attr('data-agent','safari')}}function detectCSSFeature(sFeatureName){var bFeature=false;var aDomPrefixes='Webkit Moz ms O'.split(' ');var oBody=document.body;var sFeatureNameCapital;sFeatureName=sFeatureName.toLowerCase();if(oBody.style[sFeatureName]!==undefined){bFeature=true}if(bFeature===false){sFeatureNameCapital=sFeatureName.charAt(0).toUpperCase()+sFeatureName.substr(1);for(var i=0;i<aDomPrefixes.length;i++){if(oBody.style[aDomPrefixes[i]+sFeatureNameCapital]!==undefined){bFeature=true;break}}}return bFeature}function setColorLuminance(sColor,fLum){if(sColor.substr(0,3)=='rgb'){eval('sColor = rgb2hex'+sColor.substr(3))}sColor=String(sColor).replace(/[^0-9a-f]/gi,'');if(sColor.length<6){sColor=sColor[0]+sColor[0]+sColor[1]+sColor[1]+sColor[2]+sColor[2]}fLum=fLum||0;var sRgb="#",c,i;for(i=0;i<3;i++){c=parseInt(sColor.substr(i*2,2),16);c=Math.round(Math.min(Math.max(0,c+(c*fLum)),255)).toString(16);sRgb+=("00"+c).substr(c.length)}return sRgb}function rgb2hex(r,g,b){return'#'+r.toString(16)+g.toString(16)+b.toString(16)}function initElementLinks(){$('[data-element-linked$="rue"]').mousedown(function(e){var sLinkTarget='_blank';var sLink=$(this).attr('data-element-link');if(e.which==1&&$(this).attr('data-element-linktarget')!='_blank'&&$(this).attr('data-element-linktarget')!='blank'){sLinkTarget='_self'}switch(e.which){case 1:case 2:window.open(sLink,sLinkTarget);return false}})}var oThemestageT1={init:function(){var oThemestage=$('[data-module="ThemestageT1"]');var oDtFrom=oThemestage.find('[name="DtFrom"]');var oDtTo=oThemestage.find('[name="DtTo"]');oDtFrom.on('input:change',function(){var sVal=oDtFrom.val();oDtFrom.closest('.inline-field').find('span.value').html(sVal)});oDtTo.on('input:change',function(){var sVal=oDtTo.val();oDtTo.closest('.inline-field').find('span.value').html(sVal)});this.setBadgeBorderRadius(oThemestage.find('.badge'));var oThis=this;$(window).on('resize',function(){oThis.setBadgeBorderRadius(oThemestage.find('.badge'))})},setBadgeBorderRadius:function(oElement){var lCircleWidth=oElement.outerWidth();if(oElement.outerHeight()>lCircleWidth){lCircleWidth=oElement.outerHeight()}if(oElement.find('.circle').length==0){oElement.append($('<div class="circle zp-position-a bghighlight2"></div>'))}oElement.find('.circle').css({'border-radius':lCircleWidth/2,'-webkit-border-radius':lCircleWidth/2,'width':lCircleWidth,'height':lCircleWidth});oElement.css({'opacity':1,'transform':'rotate(10deg)'})},scrollToCalendars:function(){if($(window).scrollTop()<275){$([document.documentElement,document.body]).animate({scrollTop:($('[data-module="ThemestageT1"] .request-row').first().offset().top/2)},250)}},submitBooking:function(sBookingLink){var oThemestage=$('[data-module="ThemestageT1"]');if(sBookingLink.slice(-1)!='&'){sBookingLink+='&'}sBookingLink+='arrival='+oThemestage.find('[name="DtFrom"]').val().replace(/\./g,'-');sBookingLink+='&departure='+oThemestage.find('[name="DtTo"]').val().replace(/\./g,'-');window.open(sBookingLink)}};onScrMngrLoaded(function(){$(function(){oThemestageT1.init();$('[data-module="ThemestageT1"] div.row').on('click',function(){oThemestageT1.scrollToCalendars()})})});var oRoomDetailT1={changeMealType:function(lMealType){if(!$('#RoomDetailT1Prices .tab'+lMealType).hasClass('active')){$('#RoomDetailT1Prices .tab'+lMealType).siblings().removeClass('active');$('#RoomDetailT1Prices .tab'+lMealType).addClass('active');$('#RoomDetailT1PricesMealType').val(lMealType);$('#RoomDetailT1PriceLoader').show();RoomDetailT1Prices.checkFormular(RoomDetailT1PricesData)}},resize:function(){if(window.matchMedia('(min-width: 681px').matches)return;$('section.SalesContent.Rooms.RoomDetailT1 .prices .row').css('height','auto');setTimeout(function(){var oPriceList=$('section.SalesContent.Rooms.RoomDetailT1 .prices .table');var aRows=[];oPriceList.find('.col').each(function(){var i=0;$(this).find('.row').each(function(){if(aRows[i]==0||aRows[i]==undefined||aRows[i]==''||aRows[i]<$(this).outerHeight()){aRows[i]=$(this).outerHeight()}i++})});oPriceList.find('.col').each(function(){var i=0;$(this).find('.row').each(function(){$(this).outerHeight(aRows[i]);i++})})},100)}};var oPriceListT1={resize:function(){if(window.matchMedia('(min-width: 681px').matches)return;$('[data-module="PriceListT1"] .row').css('height','auto');setTimeout(function(){$('[data-module="PriceListT1"] .room').each(function(){var aRows=[];$(this).find('.col').each(function(){var i=0;$(this).find('.row').each(function(){if(aRows[i]==0||aRows[i]==undefined||aRows[i]==''||aRows[i]<$(this).outerHeight()){aRows[i]=$(this).outerHeight()}i++})});$(this).find('.col').each(function(){var i=0;$(this).find('.row').each(function(){$(this).outerHeight(aRows[i]);i++})})})},100)}};onScrMngrLoaded(function(){$(function(){oPriceListT1.resize();$(window).on('resize',function(){oPriceListT1.resize()})})});var oListT3={_oModule:undefined,_oLoader:undefined,_oLabelField:undefined,_lLabelID:undefined,init:function(){this._oModule=$('[data-module="ListT3"]').first();this._oLabelField=this._oModule.find('#ListT3LabelID');this._oLoader=this._oModule.find('#ListT3Loader');this._lLabelID='';this._getQueryStrings();this._setQueryStrings();if(this._lLabelID!=this._oLabelField.val()){this._oLabelField.val(this._lLabelID);ListT3.checkFormular(ListT3Data)}var oThis=this;setTimeout(function(){oThis._oLoader.hide()},500)},changeLabelID:function(oElement){this._oLoader.show();if(oElement.hasClass('active')){this._lLabelID=''}else{oElement.siblings().removeClass('active');this._lLabelID=oElement.attr('data-id')}oElement.toggleClass('active');this._oLabelField.val(this._lLabelID);this._setQueryStrings();ListT3.checkFormular(ListT3Data)},initLightGallery:function(){var oElements=this._oModule.find('.elements');initLightGallery(oElements)},_getQueryStrings:function(){var aUrlParts=window.location.href.split('?');if(aUrlParts.length==2){var aQueryStrings=aUrlParts[1].split('&');for(var i=0;i<aQueryStrings.length;i++){var aParams=aQueryStrings[i].split('=');if(aParams.length==2){if(aParams[0]=='LabelID'){this._lLabelID=aParams[1]}}}}},_setQueryStrings:function(){var sQueryStrings='';if(this._lLabelID!=''&&this._lLabelID!=undefined){sQueryStrings+="LabelID="+this._lLabelID}if(sQueryStrings!=''){sQueryStrings='?'+sQueryStrings}var sUrl=window.location.protocol+"//"+window.location.host+window.location.pathname+sQueryStrings;window.history.pushState({path:sUrl},'',sUrl)}};var oMenuT1={_bInvertedHeader:undefined,_lMenuTimeOut:undefined,open:function(){this._bInvertedHeader=false;if($('body').hasClass('inverted-header')){this._bInvertedHeader=true}$('body').addClass('overflow mainmenu-open');$('body').removeClass('inverted-header');if(this._bInvertedHeader){setTimeout(function(){$('#mainmenu').fadeIn();oMenuT1.resizeHelper()},500)}else{$('#mainmenu').fadeIn();oMenuT1.resizeHelper()}},close:function(){$('#mainmenu').fadeOut();if(this._bInvertedHeader){setTimeout(function(){$('body').addClass('inverted-header')},500)}$('body').removeClass('overflow mainmenu-open')},toggle:function(){if($('#mainmenu').is(':visible')){this.close()}else{this.open()}},resizeHelper:function(){if(!$('body').hasClass('mainmenu-open'))return;var lMaxHeight=$('#mainmenu .mainmenu-container > div').height();var lHeight=$('#mainmenu .mainmenu-items').outerHeight();console.log(lMaxHeight+'<'+lHeight);if(lMaxHeight<lHeight){$('#mainmenu .mainmenu-container > div').css({'display':'block','heigth':'100%'})}else{$('#mainmenu .mainmenu-container > div').css({'display':'flex','heigth':'auto'})}},toggleSubMenu:function(oElement,sAction){if($(window).width()>1180&&window.matchMedia('(min-width: 1181px)').matches){if(sAction=='enter'&&!oElement.hasClass('active')){this._lMenuTimeOut=setTimeout(function(){oElement.addClass('active');oElement.siblings().each(function(){if($(this).hasClass('active')){$(this).find('.submenu-items').slideToggle()}});if(oElement.find('.submenu-items').is(':hidden')){oElement.find('.submenu-items').slideToggle()}oElement.siblings().removeClass('active')},250)}else if(sAction=='leave'){clearTimeout(this._lMenuTimeOut)}else return}else if(sAction=='click'){if(oElement.next().is(':visible')){oElement.closest('.mainmenu-item').removeClass('active')}else{$('#mainmenu .mainmenu-item.active .submenu-items').slideToggle();$('#mainmenu .mainmenu-item.active').removeClass('active');oElement.closest('.mainmenu-item').addClass('active')}oElement.next().slideToggle();oMenuT1.resizeHelper()}else{return}$('#mainmenu .image.active').removeClass('active');var sPageName=$('#mainmenu .mainmenu-item.active').attr('data-pagename');$('#mainmenu .image[data-pagename="'+sPageName+'"]').addClass('active')}};onScrMngrLoaded(function(){$(function(){oMenuT1.resizeHelper();$(window).on('resize',function(){oMenuT1.resizeHelper()});$('#mainmenu .mainmenu-item-text').on('click',function(){oMenuT1.toggleSubMenu($(this),'click')});$('#mainmenu .mainmenu-item').on('mouseenter',function(){oMenuT1.toggleSubMenu($(this),'enter')});$('#mainmenu .mainmenu-item').on('mouseleave',function(){oMenuT1.toggleSubMenu($(this),'leave')})})});var oHeaderT1={scrollHeader:function(){var oBody=$('body');if(oBody.attr('data-inverted-header')!='true')return;if(($(window).width()<=680||window.matchMedia('(max-width: 680px)').matches)&&oBody.hasClass('inverted-header')){return}else if(($(window).width()<=680||window.matchMedia('(max-width: 680px)').matches)&&!oBody.hasClass('inverted-header')){oBody.addClass('inverted-header');return}if($(window).scrollTop()>50&&oBody.hasClass('inverted-header')){oBody.removeClass('inverted-header')}else if($(window).scrollTop()<=50&&!oBody.hasClass('inverted-header')){oBody.addClass('inverted-header')}return},slideToggle:function(oElement){if(window.matchMedia('(max-width: 1280px)').matches){oElement.removeClass('active');return}oElement.toggleClass('active');if(oElement.hasClass('active')){var lWidth=oElement.find('.toggle-text').outerWidth();oElement.find('.width-toggle').css({'width':lWidth+'px'})}else{oElement.find('.width-toggle').css({'width':'0px'})}}};onScrMngrLoaded(function(){$(function(){oHeaderT1.scrollHeader();$(window).on('scroll resize',function(){oHeaderT1.scrollHeader()})})});onScrMngrLoaded(function(){$(function(){$('footer.pagefooter .toggle-headline').on('click',function(){oFooterT1.toggleContent($(this))})})});var oFooterT1={toggleContent:function(oElement){oElement.toggleClass('active');oElement.next().slideToggle()}};