var viewType='';var scrollToTop=0;if(Cookies.get('viewType')!==undefined){viewType=Cookies.get('viewType')}
$(document).ready(function(){$('a[class*="mm-"]').each(function(){var href=$(this).attr('href');if(href===undefined||href===''){$(this).attr('href','#')}});if($('.jsCartCountWebx').length){var url=$('.jsCartCountWebx').attr('data-url');if(url){jQuery.ajax({async:!0,type:"POST",url:url,success:function(content){if(Cookies.get('amountInCart')!==undefined){Cookies.set('amountInCart',content,{expires:7,path:'/'})}
$('.jsCartCountWebx').text(content);if((content!='')&&(content!='0')){$('.jsCartCountWebx').removeClass('d-none')}else{$('.jsCartCountWebx').addClass('d-none')}},error:function(error){console.log(error)}})}}
$('.openSearchContent').on('click',function(){$('.searchContent').toggleClass('d-none');$(this).toggleClass('active')});$('.jsOfferBook').on('click',function(){if($('.jsBookingForm').length){$('html,body').animate({scrollTop:$('.jsBookingForm').offset().top-60},'slow')}})
$('.jsOfferProviderBoxParent').on('click',function(){var uid=$(this).children('.jsOfferProviderBox').attr('id');if($(this).children('.jsOfferProviderBox').prop('checked')==!0){$(this).children('.jsOfferProviderBox').prop('checked',!1);$('.jsSelectedProvider[data-uid="'+uid+'"]').addClass('d-none').removeClass('d-flex')}else{$(this).children('.jsOfferProviderBox').prop('checked',!0);$('.jsSelectedProvider[data-uid="'+uid+'"]').addClass('d-flex').removeClass('d-none')}
offerProviderBox()})
$('.jsOfferProviderBox').on('change',function(){var value='';var uid=$(this).attr('id');if($(this).prop('checked')==!0){$('.jsSelectedProvider[data-uid="'+uid+'"]').addClass('d-flex').removeClass('d-none')}else{$('.jsSelectedProvider[data-uid="'+uid+'"]').addClass('d-none').removeClass('d-flex')}
offerProviderBox()})
function offerProviderBox(){var value='';$('.jsOfferProviderBox').each(function(){var uid=$(this).attr('id');if($(this).prop('checked')==!0){let temp=uid+'|';value=value+temp}});console.log(value);$('.jsOfferProviderRequest').val(value)}
$('.jsSelectedProvider').on('click',function(){var value='';var uid=$(this).attr('data-uid');$(this).addClass('d-none').removeClass('d-flex');$('#'+uid).prop('checked',!1);$('.jsOfferProviderBox').each(function(){if($(this).prop('checked')==!0){let temp=uid+'*'+$(this).attr('data-title')+'|';value=value+temp}});$('.jsOfferProviderRequest').val(value)})
$('.jsOfferRequest').on('click',function(){$('html,body').animate({scrollTop:$('.jsRequestForm').offset().top-50},'slow')})
var Browser;Browser=navigator.userAgent;if($('#richTextEditor1').length&&Browser.indexOf("Trident")==-1){ClassicEditor.create(document.querySelector('#richTextEditor1'),{toolbar:['heading','|','bold','italic','link','bulletedList','numberedList','blockQuote'],heading:{options:[{model:'paragraph',title:'Absatz',class:'ck-heading_paragraph'},{model:'heading3',view:'h3',title:'Hauptüberschrift',class:'ck-heading_heading2'},{model:'heading2',view:'h2',title:'Unterüberschrit',class:'ck-heading_heading3'}]}})}
if($('#richTextEditor2').length&&Browser.indexOf("Trident")==-1){ClassicEditor.create(document.querySelector('#richTextEditor2'),{toolbar:['heading','|','bold','italic','link','bulletedList','numberedList','blockQuote'],heading:{options:[{model:'paragraph',title:'Absatz',class:'ck-heading_paragraph'},{model:'heading3',view:'h3',title:'Hauptüberschrift',class:'ck-heading_heading2'},{model:'heading2',view:'h2',title:'Unterüberschrit',class:'ck-heading_heading3'}]}})}
if($('#richTextEditor11').length&&Browser.indexOf("Trident")==-1){ClassicEditor.create(document.querySelector('#richTextEditor11'),{toolbar:['heading','|','bold','italic','link','bulletedList','numberedList','blockQuote'],heading:{options:[{model:'paragraph',title:'Absatz',class:'ck-heading_paragraph'},{model:'heading3',view:'h3',title:'Hauptüberschrift',class:'ck-heading_heading2'},{model:'heading2',view:'h2',title:'Unterüberschrit',class:'ck-heading_heading3'}]}})}
if($('#richTextEditor22').length&&Browser.indexOf("Trident")==-1){ClassicEditor.create(document.querySelector('#richTextEditor22'),{toolbar:['heading','|','bold','italic','link','bulletedList','numberedList','blockQuote'],heading:{options:[{model:'paragraph',title:'Absatz',class:'ck-heading_paragraph'},{model:'heading3',view:'h3',title:'Hauptüberschrift',class:'ck-heading_heading2'},{model:'heading2',view:'h2',title:'Unterüberschrit',class:'ck-heading_heading3'}]}})}
if($('#richTextEditor111').length&&Browser.indexOf("Trident")==-1){ClassicEditor.create(document.querySelector('#richTextEditor111'),{toolbar:['heading','|','bold','italic','link','bulletedList','numberedList','blockQuote'],heading:{options:[{model:'paragraph',title:'Absatz',class:'ck-heading_paragraph'},{model:'heading3',view:'h3',title:'Hauptüberschrift',class:'ck-heading_heading2'},{model:'heading2',view:'h2',title:'Unterüberschrit',class:'ck-heading_heading3'}]}})}
if($('#richTextEditor222').length&&Browser.indexOf("Trident")==-1){ClassicEditor.create(document.querySelector('#richTextEditor222'),{toolbar:['heading','|','bold','italic','link','bulletedList','numberedList','blockQuote'],heading:{options:[{model:'paragraph',title:'Absatz',class:'ck-heading_paragraph'},{model:'heading3',view:'h3',title:'Hauptüberschrift',class:'ck-heading_heading2'},{model:'heading2',view:'h2',title:'Unterüberschrit',class:'ck-heading_heading3'}]}})}
$(document).on('input','.fileUploadField',function(e){var type='valid';var size='valid';var amount=0;$.each(e.target.files,function(key,value){amount++;var $size=value.size;var $type=value.type;if($type!='image/jpeg'&&$type!='image/png'){var type='invalid'}
if($size>=6000000){var size='invalid'}})
if(type!='valid'){alert('Erlaubte Upload-Formate sind .jpg und .png');$(this).val('')}
if(size!='valid'){alert('Das gewählte Bild ist zu groß. Die maximale Größe beträgt 6MB');$(this).val('')}
if(amount>4){alert('Sie können maximal 4 Bilder hochladen.');$(this).val('')}})
$('.jsSendInvitationConfirmation').on('click',function(e){e.preventDefault();if($('.ck-content').length){$('.ck-content').each(function(){if($(this).text()!=''){$(this).parent().parent().siblings('.rteEditorField').val($(this).text())}})}
var valid=$('.jsInvitationForm')[0].checkValidity();if(valid){$('.jsInvitationForm').submit()}else{$('.jsInvitationForm')[0].reportValidity()}})
jQuery('img:not(.jsLeaveSVG)').filter(function(){return this.src.match(/.*\.svg$/)}).each(function(){var $img=jQuery(this);var imgID=$img.attr('id');var imgClass=$img.attr('class');var imgURL=$img.attr('src');jQuery.get(imgURL,function(data){var $svg=jQuery(data).find('svg');if(typeof imgID!=='undefined'){$svg=$svg.attr('id',imgID)}
if(typeof imgClass!=='undefined'){$svg=$svg.attr('class',imgClass+' replaced-svg')}
$svg=$svg.removeAttr('xmlns:a');$img.replaceWith($svg)},'xml')});$('.fancybox, .lightbox').fancybox({loop:!0,thumbs:!1,beforeClose:function(){}});$('select:not(.multipleSelectric)').selectric({onInit:function(){if($(this).find('option:first-child').val()==''){$(this).parents('.selectric-wrapper').addClass('hideFirstOption')}},onClose:function(){var selectricWrap=$(this).parents('.selectric-wrapper');if(selectricWrap.find('select').val()!=''){if(selectricWrap.find('.removeSelect').length<=0){selectricWrap.append('<div class="removeSelect"><i class="icon icon-close"></i></div>');selectricWrap.find('.removeSelect').on('click',function(){$(this).parents('.selectric-wrapper').find('select').val('').selectric('refresh');$(this).remove()})}}
if($('#billingAddress-country').length){var index=selectricWrap.find('.selectric-scroll ul li.selected').data('index')
selectricWrap.find('select').prop('selectedIndex',index).selectric('refresh');selectricWrap.find('select').trigger('change')}},});$('select.multipleSelectric').selectric({onInit:function(){if($(this).find('option:first-child').val()==''){$(this).parents('.selectric-wrapper').addClass('hideFirstOption')}},onClose:function(){var selectricWrap=$(this).parents('.selectric-wrapper');if(selectricWrap.find('select').val()!=''){if(selectricWrap.find('.removeSelect').length<=0){selectricWrap.append('<div class="removeSelect"><i class="icon icon-close"></i></div>');selectricWrap.find('.removeSelect').on('click',function(){$(this).parents('.selectric-wrapper').find('select').val('').selectric('refresh');$(this).remove()})}}},multiple:{separator:', ',keepMenuOpen:!0,maxLabelEntries:!1}});$('#billingAddress-country').trigger('change');if($('#ke_search_sword').length&&$('.jsInsertSword')){$('.jsInsertSword').text('"'+$('#ke_search_sword').val()+'"')}
$('.jsKesearchFilter').on('click',function(e){e.preventDefault();var filterId=$(this).attr('data-uid');console.log(filterId);$('.kesearch-hiddenCheckbox').each(function(){if($(this).attr('id')===filterId){if($(this).attr('checked')=='checked'){$(this).attr('checked',!1)}else{$(this).attr('checked',!0)}}})
$('#form_kesearch_pi1').submit()})
if($('.jsResultsMessage').length&&$('.jsInsertResultMessage').length){$('.jsInsertResultMessage').append($('.jsResultsMessage'));if(viewType=='tile'&&$('.jsKeSearchArticleContainer').length){$('.article-container').addClass('tile');$('.article-list-view-option').removeClass('active');$('.article-list-view-option.tile-view').addClass('active')}}
if(jQuery('.load-morenews').length>0){$('.page-navigation').addClass('d-none');loadMoreNews()}
if(jQuery('.load-moreposts').length>0){loadMoreBlog()}
$('.blogCat').on('click',function(){$('.blog-list-row').addClass('hidden');$('.blog-list-load-more').addClass('hidden');$('.loader').removeClass('hidden')})
$('body').on('click','.tile-view,.list-view,.map-view',function(){if(!this.classList.contains('active')){if(!this.dataset.view){let lists={"tile-view":"tile","list-view":"list","map-view":"map"};for(i in lists){if(this.classList.contains(i)){this.dataset.view=lists[i]}}}
this.parentNode.querySelectorAll('div').forEach(el=>{el.classList.remove('active')});this.classList.add('active');let container=null;if(this.dataset.switch){container=document.querySelector('#'+this.dataset.switch)}else{container=document.querySelector('.article-container:not(.article-container-topnews)')}
if(this.dataset.hide){let toHide=document.querySelector("#"+this.dataset.hide);if(!toHide.classList.contains('d-none')){toHide.classList.add('d-none')}}
container.classList.remove('d-none');switch(this.dataset.view){case 'tile':container.classList.add('tile');break;case 'map':initMap();default:container.classList.remove('tile');break}
Cookies.set('viewType',this.dataset.view,{path:'/'})}});if($('.jsBreadcrumbExt').length&&$('.breadcrumb').length){var newBreadcrumbTitle=$('.jsBreadcrumbExt').attr('data-content');var newBreadcrumb='<li class="breadcrumb-item" aria-current="page" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><span itemprop="name">'+newBreadcrumbTitle+'</span></li>'
$('.breadcrumb').append(newBreadcrumb)}
var $offerArrival=$('#jsOfferArrival');var $offerDeparture=$('#jsOfferDeparture');if($offerArrival.length){$offerArrival.datepicker({minDate:0,dateFormat:'dd.mm.yy',onSelect:function(selected){$offerDeparture.datepicker("option","minDate",selected)}});$offerDeparture.datepicker({minDate:0,dateFormat:'dd.mm.yy',onSelect:function(selected){$offerArrival.datepicker("option","maxDate",selected)}})};$('.tx-powermail form, .tx-powermail input, .tx-powermail textarea, select').each(function(){$(this).attr('autocomplete','off')});(function(){ll=new LazyLoad({elements_selector:".lazy",effect:"fadeIn",effectTime:200,load_delay:30,threshold:200});lv=new LazyLoad({elements_selector:".lazyVideo",})})();$('.footer-title').on('click',function(){$(this).next('.footer-content').toggle()});$('.langNavOpen').on('click',function(){$(this).toggleClass('open').parents('.navi-lang').find('.nonactive').toggle()});$('.btnOpenSearchPopup').on('click',function(){$('.closeParent').toggle();$('.mm-wrapper').toggleClass('position-fixed');$('#searchInput').focus()});$('.btnCloseSearchPopup').on('click',function(){$('.closeParent').toggle();$('.mm-wrapper').toggleClass('position-fixed')});$('.navi-topicons__item-link.dropdown').on('click',function(){$(this).next('.dropdown-menu').toggleClass('open')});$('.VideoHighlightsHero__scroll').on('click',function(){$('html,body').animate({scrollTop:jQuery('#main').offset().top},'slow')});$('.btnPlayVideo').on('click',function(){$(this).hide();var video=$($(this).data('video'));video.attr('src',video.data('src')+'?autoplay=1&rel=0&modestbranding=1&enablejsapi=1').next('picture').addClass('hide')});$('.btnInputCounter').on('click',function(){var input=$(this).parent().find('input');var iputVal=parseInt(input.val())+parseInt($(this).data('count'));iputVal=(iputVal>=input.attr('min'))?iputVal:input.attr('min');if(typeof input.attr('max')!=='undefined'&&input.attr('max')!==!1){console.log(input.attr('max'));iputVal=(iputVal<=input.attr('max'))?iputVal:input.attr('max')}
input.val(iputVal);input.trigger('change')});$('.searchItemInput').on('input change propertychange',function(){var input=$(this);var placeItem=$(input.data('search'));placeItem.html(input.val())});$('.quickChildren').on('change propertychange',function(){var childs=$(this).val();if(childs>=1){var i=1;$(this).parents('.powermail_fieldwrap').next('.childageContainer').find('.childage').each(function(){if(childs>=i){$(this).show().addClass('active')}else{$(this).hide().removeClass('active')}
i++});$(this).parents('.powermail_fieldwrap').next('.childageContainer').show()}else{$(this).parents('.powermail_fieldwrap').next('.childageContainer').hide()}});$('.openFlyout:not(.flyoutlinkNoPopup)').on('click',function(e){let jsEventFilterForm=document.querySelectorAll(".jsEventFilterForm");let returnIt=!1;for(const node of jsEventFilterForm){if(!node.closest(".flyoutContent")){returnIt=!0}}
if(returnIt&&typeof e.target.dataset.event!=="undefined"&&e.target.dataset.event==1){document.querySelectorAll(".openFlyout").forEach(node=>{node.classList.remove("active")});document.querySelectorAll(".flyoutContent").forEach(node=>{node.classList.add("d-none")});document.querySelector('html').classList.remove("fixed");return}
e.preventDefault();var $this=$(this);var $thisContent=$(this).parent().children('.flyoutContent');$('.openFlyout').not($this).removeClass('active');$('.flyoutContent').not($thisContent).addClass('d-none');$(this).toggleClass('active');$(this).parent().children('.flyoutContent').toggleClass('d-none');if($(this).hasClass('active')){$('html').addClass('fixed')}else{$('html').removeClass('fixed')}});$('.closeFlyout').on('click',function(e){e.preventDefault();$('html').removeClass('fixed');$(this).parents('.flyoutItemContainer').find('.openFlyout').trigger('click')});$('.lazyHTML').each(function(){var lazyHTML=$(this);if(lazyHTML.data('html')!==undefined){$(window).on('resize scroll',function(){if(lazyHTML.offset().top<$(window).scrollTop()+$(window).height()&&lazyHTML.text()==''){lazyHTML.html(lazyHTML.data('html'));$.getScript(lazyHTML.find('script').attr('src'),function(){streamchartzLoadWall()})}})}})});$(window).on('scroll load',function(){if(($(this).scrollTop()>50)&&(x=$(this).scrollTop()>scrollToTop)){$('body').addClass('top-fixed--down')}else{$('body').removeClass('top-fixed--down')}
if($(this).scrollTop()>50){$('body').addClass('top-fixed')}else{$('body').removeClass('top-fixed')}
scrollToTop=$(this).scrollTop()});let lazyloadImages=document.querySelectorAll(".lazyBg");if("IntersectionObserver" in window){let imageObserver=new IntersectionObserver(function(entries,observer){entries.forEach(function(entry){if(entry.isIntersecting){const image=entry.target;image.classList.remove("lazyBg");imageObserver.unobserve(image)}})});lazyloadImages.forEach(function(image){imageObserver.observe(image)})}
function scroll_to_anchor(anchor_id){var targetSelector=$(anchor_id);var $target=$(targetSelector);$('html, body').animate({scrollTop:$target.offset().top-100},{duration:2000,step:function(now,fx){var newOffset=$target.offset().top-100;if(fx.end!==newOffset)
fx.end=newOffset}})}
if(document.querySelector('.quicksearch-form')){document.querySelectorAll('.quicksearch-form').forEach(elem=>{elem.addEventListener("submit",function(e){e.preventDefault();let children=[];let from;let to;if(this.querySelector('.quickChildren')&&this.querySelector('.quickChildren').value>0){this.querySelectorAll('.childage.active').forEach(childAge=>{children.push(parseInt(childAge.querySelector('.childrenAge').value))})}
if(this.querySelector('.quickDateFrom')&&this.querySelector('.quickDateFrom').value){from=parseDate(this.querySelector('.quickDateFrom').value)}
if(this.querySelector('.quickDateTo')&&this.querySelector('.quickDateTo').value){to=parseDate(this.querySelector('.quickDateTo').value)}
let uri=this.dataset.uri;dw.accommodationQuickFind('kitzbu',{dateFrom:from,dateTo:to,occupancy1:{units:this.querySelector('.quickUnits').value,adults:this.querySelector('.quickAdults').value,children:children}},()=>{window.location.href=uri})})});parseDate=(date)=>{if(date.includes('-')){return new Date(date)}else{let tmp=date.split('.');return new Date(parseInt(tmp[2],10),parseInt(tmp[1],10)-1,parseInt(tmp[0],10),)}}}
function loadContent(el){let contentContainer=$($(el).data('target'));if(contentContainer.find('.jsLoading')){var href=$(el).data('contenturl');let blockLoad=!1;if(($(el).data('event')=='1')&&(document.querySelector('.jsEventFilterForm'))){$('html, body').animate({scrollTop:$("#event-list").offset().top},1000);return}
contentContainer.load($(el).data('contenturl')+' .innerContent',async()=>{contentContainer.find('.jsLoading').remove();executeScripts(contentContainer);(function(){ll=new LazyLoad({elements_selector:".lazy",effect:"fadeIn",effectTime:200,load_delay:30,threshold:200});lv=new LazyLoad({elements_selector:".lazyVideo",})})();let nativeContainer=contentContainer[0];if(typeof nativeContainer.dataset.url==='undefined'){console.log(el.dataset.contenturl);nativeContainer.dataset.url=el.dataset.contenturl}
if(nativeContainer.querySelector('.tx-webx-bookingemo')){console.log("webx_bookingemo loaded")
if(typeof WebxDatePicker==='undefined'){blockLoad=!0;await getBookingemoScripts();blockLoad=!1}else{new WebxDatePicker(".webxDP",{lang:'de'})}
let lang="de";switch(window.location.href.split("/")[3]){case "en":case "nl":lang="en"}
let uri=window.location.pathname+'/.emoajax';if(typeof nativeContainer.dataset.url!=='undefined'){uri=window.location.origin+nativeContainer.dataset.url+'/.emoajax'}
jQuery(".tx-webx-bookingemo .searchView form:not(.noJsSubmit):not(.listening)").unbind("submit");jQuery(".tx-webx-bookingemo .searchView form:not(.noJsSubmit):not(.listening)").submit((e)=>listSubmit(e,uri))}})}}
const getBookingemoScripts=async()=>{let head=document.getElementsByTagName("head")[0]
const scripts=[{src:'/typo3conf/ext/webx_bookingemo/Resources/Public/JS/datepicker.min.js',function:'WebxDatePicker',type:'text/javascript'},{src:'/typo3conf/ext/webx_bookingemo/Resources/Public/JS/datepicker.min.de.js',function:'WebxDatePicker',type:'text/javascript'},{src:'/typo3conf/ext/webx_bookingemo/Resources/Public/JS/webx_ajaxfunctions.js',function:'bookingAjax',type:'text/javascript'},{src:'/typo3conf/ext/webx_bookingemo/Resources/Public/JS/webx_main.js',function:'listSubmit',type:'text/javascript'},{src:'/typo3conf/ext/webx_bookingemo/Resources/Public/JS/pagination.js',function:'paginate',type:'text/javascript'},{src:'/typo3conf/ext/webx_bookingemo/Resources/Public/JS/intersection-observer.js',type:'text/javascript'},]
for(const scriptObj of scripts){let script=document.createElement("script");script.src=scriptObj.src;script.type="text/javascript";head.appendChild(script);let wait=0;let awaitInit=async()=>{if(wait++>50){console.error('fetch error:');console.error(scriptObj.src);return!1}
let funExists=!1
switch(scriptObj.function){case 'WebxDatePicker':if(typeof WebxDatePicker==='function'){funExists=!0}
break;case 'listSubmit':if(typeof listSubmit==='function'){funExists=!0}
break;case 'bookingAjax':if(typeof bookingAjax==='function'){funExists=!0}
break;case 'paginate':if(typeof paginate==='function'){funExists=!0}
break;default:funExists=!0}
if(funExists){return!0}else{await new Promise((resolve)=>setTimeout(resolve,50));return awaitInit()}}
if(!await awaitInit()){return!1}}
return!0}
function executeScripts(container){container.find('.script').each(function(){var scriptText=$(this).text();var newScript=document.createElement('script');newScript.text=scriptText;document.head.appendChild(newScript).parentNode.removeChild(newScript);$(this).remove()})}
jQuery.loadScript=function(url,callback){jQuery.ajax({url:url,dataType:'script',success:callback,async:!0})}
$(window).on("load",function(){if($("#popup").length>0){$('.popupHidden').on('click',function(){Cookies.set("popuppage","hidden",{expires:0.5,path:'/'});$("#popup").removeClass("show")});if(Cookies.get("popuppage")!="hidden"){setTimeout(function(){$("#popup").addClass("show")},3000)}}})