jQuery.extend({isValidSelector:function(selector){if(typeof(selector)!=='string'){return!1}
try{var $element=$(selector)}catch(error){return!1}
return!0}});if(window.location.hash){let hash=window.location.hash;if(hash.indexOf('/')<0&&hash.indexOf('cat=')<0&&hash.indexOf('filter=')<0){if($.isValidSelector(hash)&&$(hash).length>0){$('html, body').animate({scrollTop:$(hash).offset().top},1500,'swing')}}}
$(document).ready(function(){$(window).on('scroll',function(){if($(this).scrollTop()>300){$('.cookieControlModalButton').addClass('_visible')}else{$('.cookieControlModalButton').removeClass('_visible')}})});$(document).ready(function(){function updateCurrentWeather(){$.ajax({type:"GET",url:wetterAjaxUrl,success:function(results){$('.icon-menu .__item._wetter .__temp').html(results.TEMPERATUR+"°C");$('.saasfee-card.saasfee .__temp').html(results.TEMPERATUR+"°C")}})}
updateCurrentWeather();setInterval(updateCurrentWeather,60*1000);function updateWinterReportsDCE(){$.ajax({type:"GET",url:pistenAjaxUrl,success:function(result){$('.winterDCE .slope-progressbar.__cable_cars').data('numberopen',result.slopes.totalAndOpenLifts.open)
$('.winterDCE .slope-progressbar.__cable_cars').data('numbertotal',result.slopes.totalAndOpenLifts.total)
$('.winterDCE .slope-progressbar.__slopes').data('numberopen',result.slopes.totalAndOpenSlopes.open)
$('.winterDCE .slope-progressbar.__slopes').data('numbertotal',result.slopes.totalAndOpenSlopes.total)
if($('.winterDCE .slope-progressbar.__slopes').hasClass('_km')){if(result.slopes.totalAndOpenSlopes.openLen<1000){$('.winterDCE .slope-progressbar.__slopes').data('numberopen',(result.slopes.totalAndOpenSlopes.openLen/1000).toFixed(2))}else{$('.winterDCE .slope-progressbar.__slopes').data('numberopen',Math.round(result.slopes.totalAndOpenSlopes.openLen/1000))}
$('.winterDCE .slope-progressbar.__slopes').data('numbertotal',Math.round(result.slopes.totalAndOpenSlopes.totalLen/1000))}
$('.winterDCE .slope-progressbar.__leasure_facilities').data('numberopen',result.pois.open)
$('.winterDCE .slope-progressbar.__leasure_facilities').data('numbertotal',result.pois.total)
$('.winterDCE .slope-progressbar').each(function(){let $this=$(this);$this.find(".progress-container").find('.progress').empty()});drawProgressBars()},error:function(error){console.log('error getting the winter dce data')
console.log(error)}})}
if($('.winterDCE').length>0){updateWinterReportsDCE()}
if($('.slope-progressbar').length>0){drawProgressBars()}})