var Accordion=(function(){var that;function addClickEvents(){$('.modules--accordion').each(function(){var $accordion,$moreLink,moreVisible;$accordion=$(this);$moreLink=$accordion.find('.modules--accordion--more--link');moreVisible=($accordion.attr('data-more-visible')=='yes');$accordion.find('.modules--accordion--item').each(function(){var $item,$head,$body,isOpen;$item=$(this);$head=$item.find('.modules--accordion--item--header');$body=$item.find('.modules--accordion--item--content');isOpen=($item.attr('data-open')=='yes');if(isOpen){$body.slideDown()}
$head.on('click',function(){$item.closest('.modules--accordion').find('.modules--accordion--item[data-open="yes"]').not($item).find('.modules--accordion--item--header').trigger('click');isOpen=!isOpen;$item.attr('data-open',isOpen?'yes':'no');$body[isOpen?'slideDown':'slideUp']()})});$moreLink.on('click',function(){moreVisible=!moreVisible;$accordion.attr('data-more-visible',moreVisible?'yes':'no').find('[data-hidden="'+(moreVisible?'yes':'shown')+'"]')[moreVisible?'slideDown':'slideUp']().attr('data-hidden',(moreVisible?'shown':'yes'));$moreLink.addClass('faded');setTimeout(function(){$moreLink.text($moreLink.attr(moreVisible?'data-text-less':'data-text-more')).removeClass('faded')},250)})})}
that={init:function(){addClickEvents()}};return that})();var Breakpoints=(function(){var that,breakpoints,$body;breakpoints=null;function detectBreakpoints(){if(breakpoints==null){breakpoints=[];$('#vnc-breakpoints div').each(function(){breakpoints.push($(this).data('breakpoint'))})}}
function detectMobileMenu(){var menuWidth,childrenWidth,menuLine,wasMobileMenu,isMobileMenu;wasMobileMenu=$body.hasClass('isMobileMenu');$body.removeClass('isMobileMenu');isMobileMenu=!1;childrenWidth=0;$('.navbar-2021 .line-second').children().each(function(){childrenWidth+=this.offsetWidth});menuLine=document.querySelector('.navbar-2021 .line-second');if(menuLine){menuWidth=document.querySelector('.navbar-2021 .line-second').offsetWidth;if(childrenWidth>menuWidth){isMobileMenu=!0}}
if(isMobileMenu){$body.addClass('isMobileMenu')}
if(isMobileMenu!=wasMobileMenu){Navigation.update(isMobileMenu)}}
$(document).ready(function(){$body=$('body');$(window).on('resize',detectMobileMenu);detectMobileMenu()});that={getBreakpoint:function(){return $('#vnc-breakpoints div:visible').first().data('breakpoint')},isLower:function(breakpoint){detectBreakpoints();return(breakpoints.indexOf(that.getBreakpoint())<breakpoints.indexOf(breakpoint))},isLowerOrEqual:function(breakpoint){detectBreakpoints();return(breakpoints.indexOf(that.getBreakpoint())<=breakpoints.indexOf(breakpoint))},isGreater:function(breakpoint){detectBreakpoints();return(breakpoints.indexOf(that.getBreakpoint())>breakpoints.indexOf(breakpoint))},isGreaterOrEqual:function(breakpoint){detectBreakpoints();return(breakpoints.indexOf(that.getBreakpoint())>=breakpoints.indexOf(breakpoint))},mobileMenu:function(){if(that.isLower('xl')){return!0}else{return!1}}};return that})();var ContactItemLinks=(function(){var that;function addClickEvents(){$('.contact__item').on('click',function(event){event.stopImmediatePropagation();var link=$(this).find('a');var isAddress=$(this).find('.contact__item__icon--address');if(link.length>0){link[0].click()}
if(isAddress.length===1){if(!location.href.includes('#map')){location.href+='#map'}}})}
that={init:function(){addClickEvents()}};return that})();var ContentElements=(function(){var that;function equalHeight(){$('.vnc-equal-height-container').each(function(){var h;h=0;$(this).find('.vnc-equal-height').height('auto').each(function(){h=Math.max(h,$(this).height())}).height(h)})}
$(document).ready(function(){$(window).on('resize',equalHeight);equalHeight()});function addClickEvents(){$(document).on('click','.home-teaser a',function(event){event.stopPropagation()});$(document).on('click','.home-teaser',function(){var $a;$a=$(this).find('a');if($a.length>0){if($a.attr('target')=='_blank'){window.open($a.attr('href'))}else{document.location.href=$a.attr('href')}}});$(document).on('click','.link-toggle',function(event){var $toggleItem;$toggleItem=$(this).closest('.toggle-item');$toggleItem.toggleClass('toggle-item--open');$toggleItem.find('.toggle-item-content').stop()[$toggleItem.hasClass('toggle-item--open')?'hide':'show']()[$toggleItem.hasClass('toggle-item--open')?'slideDown':'slideUp']()})}
that={init:function(){addClickEvents()}};return that})();var Event=(function(){var $activeEventItem=null;function addClickEvents(){$(document).on('click','.events a[data-lightbox]',function(e){var url;e.preventDefault();$activeEventItem=$(this);that.show($activeEventItem);url=$activeEventItem.attr('data-href');$.get(url).done(function(msg){that.addContent(msg)})})}
var that;that={init:function(){addClickEvents()},show:function(){Lightbox.show()},addContent:function(data){Lightbox.appendContent(data,!0)}};return that})();var Footer=(function(){var that;function addClickEvents(){$('#toTop').on('click',function(){$("html, body").animate({scrollTop:0},"slow");return!1})}
that={init:function(){addClickEvents()}};return that})();var VNC_GOOGLE_MAPS_KEY='AIzaSyD3Mr8tt-8kC2aFhvj5Vh0pWCDK3zCstHs';var GoogleMaps=(function(){var that,$map,bounds,infoWindow,loaded;var CONSENT_GROUP='C0003';function initialize(){if(String(decodeURIComponent(String(String(String(String(document.cookie).split('OptanonConsent=')[1]).split(';')[0]).split('groups=')[1]).split('&')[0])).indexOf(CONSENT_GROUP+':1')>-1){loadMaps()}else{$('#mapLoadButton').on('click',function(){that.run()})}}
function loadMaps(){if(!loaded){loaded=!0;$.getScript('https://maps.google.com/maps/api/js?key='+VNC_GOOGLE_MAPS_KEY+'&libraries=places&callback=GoogleMaps_run')}}
function render(){var map,position,lat,lng,dealers;$map=$('#map').addClass('loaded');map=new google.maps.Map($map.get(0),{disableDefaultUI:!0,styles:that.mapStyles()});dealers=that.getDealers();that.setMarkers(map,dealers);map.fitBounds(bounds);map.panToBounds(bounds);map.setOptions({maxZoom:13,minZoom:7});infoWindow=new google.maps.InfoWindow();lat=parseFloat($map.data('lat'));lng=parseFloat($map.data('lng'));if(!isNaN(lat)&&!isNaN(lng)){position={lat:lat,lng:lng};map.setOptions({center:position})}}
loaded=!1;that={init:function(){initialize()},run:function(){if(loaded){if($('#map').length>0){render()}}else{loadMaps()}},codeAdress:function(){},icons:function(){var iconBase;iconBase=$map.data('icons-path');return{dealerActive:{icon:iconBase+'active.png'},dealer:{icon:iconBase+'default.png'}}},getDealers:function(lat,lng){var dealers=[];$('.dealer-marker').each(function(){var $dealerMarker;$dealerMarker=$(this);dealers.push({$marker:$dealerMarker,position:new google.maps.LatLng(parseFloat($dealerMarker.data('lat')),parseFloat($dealerMarker.data('lng'))),type:$dealerMarker.hasClass('dealer-marker-primary')?'dealerActive':'dealer'})});return dealers},setMarkers:function(map,dealers){var icons,loc,i,infoWindows;bounds=new google.maps.LatLngBounds();icons=that.icons();for(i=0;i<dealers.length;i++){(function(){var marker,dealer;dealer=dealers[i];marker=new google.maps.Marker({position:dealer.position,icon:icons[dealer.type].icon,map:map});loc=new google.maps.LatLng(marker.position.lat(),marker.position.lng());bounds.extend(loc);google.maps.event.addListener(marker,'click',function(){infoWindow.close();infoWindow.setContent(dealer.$marker.html());infoWindow.open(map,marker)})})()};return bounds},mapStyles:function(){return[{"featureType":"poi","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#e9e9e9"},{"lightness":17}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#ffffff"},{"lightness":29},{"weight":0.2}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":16}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":21}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#dedede"},{"lightness":21}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#ffffff"},{"lightness":16}]},{"elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#333333"},{"lightness":40}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#f2f2f2"},{"lightness":19}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#fefefe"},{"lightness":20}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#fefefe"},{"lightness":17},{"weight":1.2}]}]}};return that})();function GoogleMaps_run(){GoogleMaps.run()}
var IframeScroll=(function(){var that;function addMessageHandler(){window.addEventListener('message',function(event){var message=JSON.parse(event.data);if(message.type==='scroll'){$('html, body').animate({scrollTop:message.data.top},1000)}})}
that={init:function(){addMessageHandler()}}
return that})();var ImageGallery=(function(){var that,ID;var $slick;function addClickEvents(){$('[data-gallery="simple"] picture').on('click',function(){that.simpleGallery($(this))});$('.gallery-link--more').on('click',function(){$(this).closest('.gallery-container').find('picture').first().trigger('click')});$(document).on('keydown',function(event){if(event.which===37){$('.carousel').carousel('prev')}else if(event.which===39){$('.carousel').carousel('next')}});if($('[data-gallery="slicky"]').length>0){$slick.on('staticClick.flickity',function(event,pointer,cellElement,cellIndex){that.simpleGallery($(cellElement).find('picture'))})}}
ID=0;function getGalleryTitle($galleryGrid,$picture){let galleryTitle=$galleryGrid.data('gallery-title');if(!galleryTitle||(galleryTitle=='')){galleryTitle=!1}
let picCaption=$picture.data('caption');if(!picCaption||(picCaption=='')){picCaption=!1}
return(galleryTitle?galleryTitle:'')+((galleryTitle&&picCaption)?' &ndash; ':'')+(picCaption?picCaption:'')}
that={init:function(){let $flickityItem=$('[data-gallery="slicky"]');if($flickityItem.length>0){$slick=$flickityItem.flickity({cellAlign:'center',contain:!0,pageDots:!1,freeScroll:!0,prevNextButtons:($flickityItem.children().length>4),setGallerySize:!1,groupCells:3})}
addClickEvents()},simpleGallery:function($selectedPicture){var $galleryGrid,$pictures,$carouselInner,randomId,currentIndex;ID++;randomId='carousel-'+ID;$galleryGrid=$selectedPicture.closest('[data-gallery]');$pictures=$galleryGrid.find('picture');$carouselInner=$('<div>').addClass('carousel-inner');$.each($pictures,function(index,picture){var $picture,isActive;$picture=$(picture);isActive=$picture.is($selectedPicture);$carouselInner.append($('<div>').addClass('carousel-item'+(isActive?' active':'')).append($('<picture>').append($('<source>').attr({media:'(orientation: landscape)',srcset:$picture.attr('data-lightbox-srcset-landscape')}),$('<source>').attr({media:'(orientation: portrait)',srcset:$picture.attr('data-lightbox-srcset-portrait')}),$('<img>').attr({src:$picture.attr('data-lightbox-src'),alt:$picture.find('img').attr('alt')}))))});currentIndex=$carouselInner.find('.carousel-item.active').index()+1;Lightbox.show();Lightbox.appendContent($('<div>').attr('id',randomId).addClass('carousel carousel-gallery slide').attr('data-ride','carousel').append($carouselInner));Lightbox.appendHeaderLeft($('<div>').addClass('gallery-lightbox-header').append($('<div>').addClass('indicator-wrapper').append($('<a>').addClass('carousel-control-prev').attr({'data-slide':'prev','href':'#'+randomId,'role':'button'}).append($('<span>').addClass('carousel-control-prev-icon').attr('area-hidden','true'),$('<span>').addClass('sr-only')),$('<span>').addClass('indicator').append($('<span>').addClass('indicator-current').text(currentIndex),$('<span>').text('/'),$('<span>').text($pictures.length)),$('<a>').addClass('carousel-control-next').attr({'data-slide':'next','href':'#'+randomId,'role':'button'}).append($('<span>').addClass('carousel-control-next-icon').attr('area-hidden','true'),$('<span>').addClass('sr-only'))),$('<div>').append($('<p>').addClass('lightbox-caption').html(getGalleryTitle($galleryGrid,$selectedPicture)))));$('#'+randomId).carousel({keyboard:!1,interval:!1});$('#'+randomId).on('slid.bs.carousel',function(){let $activePicture=$carouselInner.find('.carousel-item.active');currentIndex=$activePicture.index()+1;$('.gallery-lightbox-header .indicator-current').text(currentIndex);$('.gallery-lightbox-header .lightbox-caption').html(getGalleryTitle($galleryGrid,$galleryGrid.find('picture').eq($activePicture.index())))})}};return that})();var Information=(function(){var that,json;function setCookie(cName,cValue,expDays){let date=new Date();date.setTime(date.getTime()+(expDays*24*60*60*1000));const expires="expires="+date.toUTCString();document.cookie=cName+"="+cValue+"; "+expires+"; path=/"}
function getCookie(cName){const name=cName;const cDecoded=decodeURIComponent(document.cookie);const cArr=cDecoded.split('; ');let res;cArr.forEach(val=>{if(val.indexOf(name)===0){res=val.substring(name.length);return!0}});return!1}
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1,c.length)}
if(c.indexOf(nameEQ)==0){return parseInt(c.substring(nameEQ.length,c.length))}}
return null}
function setMargin(){if($(".warning").length<2){$(".warning").css("marginBottom",0)}}
function checkMSG(place){return typeof place!=='undefined'}
function setHTML($warningType,message,place){if(checkMSG(place)||place===null){$warningType.html(message)}}
function arrangeHeight(){}
function getJSON(){var $json;if($('#vnc-warnings div').data('api-warning-url')!=='undefined'){$json=$('#vnc-warnings div').data('api-warning-url')}else{return console.log("no json")}
$.getJSON($json,function(data){var general,local,$cookieIDG,$cookieIDL,dealerID,generalID;json=data;$(document).ready(function(){var $localHtml,$globalHtml;if(!$.isEmptyObject(json.dealer)){dealerID=json.dealer.uid;local=json.dealer.text;if(readCookie('warning_local')!==dealerID&&local.length){arrangeHeight();$('.navbar-2021').after('<div class="\warning local\" data-cookie='+dealerID+'></div>');if(json.dealer.variant==1){$('.warning.local').addClass("warning--loud")}}
$localHtml=$('.warning.local');setHTML($localHtml,local,dealerID);$localHtml.append('<a class=\"warning__close\"><span></span><span></span></a>')}
if(!$.isEmptyObject(json.global)){generalID=json.global.uid;general=json.global.text;if(readCookie('warning_general')!==generalID&&general.length){arrangeHeight();$('.navbar-2021').after('<div class="\warning general\" data-cookie='+generalID+'></div>');if(json.global.variant==1){$('.warning.general').addClass("warning--loud")}}
$globalHtml=$('.warning.general');setHTML($globalHtml,general,null);$globalHtml.append('<a class=\"warning__close\"><span></span><span></span></a>')}
setMargin();let cookies=document.cookie;$('.local .warning__close').on('click',function(){var $this;$this=$(this);$this.closest('.warning').fadeOut();$cookieIDL=$this.closest('.warning').data('cookie');setCookie('warning_local',$cookieIDL,7);arrangeHeight();setMargin()});$('.general .warning__close').on('click',function(){var $this;$this=$(this);$this.closest('.warning').fadeOut();$cookieIDG=$this.closest('.warning').data('cookie');setCookie('warning_general',$cookieIDG,7);arrangeHeight();setMargin()})})})}
that={init:function(){getJSON()},};return that})();var Lightbox=(function(){var that,isOpen;var lightbox='lightbox';var lightboxOpen='lightbox-open';isOpen=!1;function addClickEvents(){$('[data-lightbox="close"]').on('click',function(){that.close()});$(document).on('keydown',function(e){if(e.which==27){that.close()}})}
$(window).on('popstate',function(event){if(location.hash=='#close-lightbox'){that.close()}});that={show:function(){that.close();isOpen=!0;history.pushState({},document.title,"#close-lightbox");history.pushState({},document.title,"#lightbox");$('body').addClass(lightboxOpen).append($('<div>').addClass(lightbox).css('margin-top',$(window).height()).animate({opacity:1,'margin-top':'0'},400,function(){}).append($('<div>').addClass(lightbox+'--header').append($('<div>').addClass('lightbox--header__left'),$('<div>').append($('<i>').addClass('icon icon--close').attr('data-lightbox','close'))),$('<div>').addClass(lightbox+'--content')));addClickEvents()},close:function(){if(isOpen){history.go(-1);history.replaceState({},document.title,"")}
isOpen=!1;$('body').removeClass(lightboxOpen);$('.'+lightbox).animate({'margin-top':$(window).height()},400,function(){$('.'+lightbox).remove()})},appendContent:function(data,scrollable){$('.'+lightbox+'--content').append($(data));if(scrollable){$('.'+lightbox+'--content').addClass(lightbox+'--content--scrollable')}},appendHeaderLeft:function(data){$('.'+lightbox+'--header__left').empty().append($(data))}};return that})();var Navigation=(function(){var that,isMobileMenu,hasMenu,activeFilter;isMobileMenu=null;activeFilter='';$(document).ready(function(){var resizeTimer;if($('.navbar-2021 .line-second').length>0){hasMenu=!0;(function(){window.SCROLLBAR_WIDTH=0;function calculateScrollbarWidth(){var w,$html;$html=$('html');w=$html.css('overflow','hidden').outerWidth();SCROLLBAR_WIDTH=w-$html.css('overflow','').outerWidth();$html.css('--scrollbar-width',SCROLLBAR_WIDTH+'px')}
$(window).on('resize',calculateScrollbarWidth);calculateScrollbarWidth()})();$(window).on('resize',function(){clearTimeout(resizeTimer);resizeTimer=setTimeout(function(){$('body').addClass('disable-transitions');that.selectMenu();setTimeout(function(){$('body').removeClass('disable-transitions')},100)},500)}).trigger('resize');renderMobileMenu()}else{hasMenu=!1;$('body').addClass('navbar-simple')}});function bodyNoScroll(scroll){if(scroll){$('body').addClass('no-scroll')}else{$('body').removeClass('no-scroll')}}
function addClickEvents(){$('.dropdown-toggle').on('click',function(){var $dropDownMenu=$(this).parent().find('.dropdown-menu');$('.dropdown-menu').slideUp(0);if(!$dropDownMenu.hasClass('show')){$dropDownMenu.slideUp(0).slideDown(500)}else{$dropDownMenu.show().slideUp(500)}
$('.nav--car-model').animate({scrollTop:0},400,'swing')});$(document).on('click',function(){$('.dropdown-menu').slideUp(500);bodyNoScroll(!1)});$(".dropdown-menu").click(function(e){e.stopPropagation()});$('[data-nav-category]').on('click',function(){var target=$(this).data('nav-category');$('.nav--car-model').animate({scrollTop:(parseInt($('.'+target).offset().top,10))-200},400,'swing')});$('.icon--menu-back').on('click',function(){$(this).closest('.dropdown-toggle').trigger('click');$(document).trigger('click')});$('#navModel').on('click',function(){if($(this).parent().hasClass('show')){bodyNoScroll(!1)}else{bodyNoScroll(!0)}})}
function adjustPadding(){$('body').css({})}
function renderMobileMenu(){var $menu,$logo;$logo=$('.navbar-2021 .line-first-logo');$menu=$('<div>').addClass('mobile-nav-2021').on('click',mobileMenu_hide);$menu.append($('<div>').addClass('mobile-menu').append($('<div>').addClass('mobile-menu-items').html($('.navbar-2021 .line-second-menu').html()).prepend($('<div>').addClass('mobile-menu-header').append($('<a>').attr('href',$logo.attr('href')).append($logo.html()),$('<div>').addClass('menuClose').html($('#menuOpen').html())),$('<div>').addClass('mobile-menu-subheader').append($('<div>').addClass('menuBack'),$('<div>').addClass('menuTitle'),$('<div>').addClass('menuClose icon--close')))));$menu.find('.keep-visible').remove();$menu.find('.dropdown-menu').removeClass('dropdown-menu').addClass('mobile-menu-item');$menu.find('.dropdown-menu-container').removeClass('dropdown-menu-container').addClass('mobile-menu-subitems');$menu.find('.dropdown-toggle').removeClass('dropdown-toggle').each(function(){this.removeAttribute('data-toggle')}).on('click',function(event){var $this;$this=$(this);event.preventDefault();$menu.addClass('subItemsVisible').find('.nav-item').removeClass('isActive');$this.closest('.nav-item').addClass('isActive').find('.mobile-menu-subitems').scrollTop(0);$menu.find('.mobile-menu-subheader .menuTitle').html($this.html())});$menu.find('.dropdown-item').removeClass('dropdown-item');$('body').append($menu);$('#menuOpen').on('click',mobileMenu_show);$('.menuClose').on('click',mobileMenu_hide);$('.menuBack').on('click',mobileMenu_back);$('.mobile-nav-2021').on('click',mobileMenu_hide);$('.mobile-menu').on('click',function(event){event.stopPropagation()})}
function mobileMenu_hide(){$('body').removeClass('mobileMenuVisible')}
function mobileMenu_show(){mobileMenu_back();$('body').addClass('mobileMenuVisible')}
function mobileMenu_back(){$('.mobile-nav-2021').removeClass('subItemsVisible').find('.nav-item').removeClass('isActive')}
function activateModelFilters(){activeFilter=$('.has-filters .model-filters-filter').first().attr('data-trigger-filter');$('[data-trigger-filter]').on('click',function(){activeFilter=$(this).toggleClass('open').attr('data-trigger-filter');$('[data-filter-id="'+activeFilter+'"]').toggleClass('open');showActiveFilter(!1)});showActiveFilter(!0)}
function showActiveFilter(quick){$('[data-trigger-filter]').removeClass('active');$('[data-trigger-filter="'+activeFilter+'"]').addClass('active');if(isMobileMenu){$('[data-filter-id]:not(.open)')[quick?'hide':'slideUp']();$('[data-filter-id].open')[quick?'show':'slideDown']()}else{$('[data-filter-id]:not([data-filter-id="'+activeFilter+'"])')[quick?'hide':'slideUp']();$('[data-filter-id="'+activeFilter+'"]')[quick?'show':'slideDown']()}}
that={init:function(){addClickEvents();activateModelFilters()},selectMenu:function(){},update:function(isMobile){isMobileMenu=isMobile;showActiveFilter(!0)}};return that})();var News=(function(){var $activeNewsItem=null;function addClickEvents(){$(document).on('click','.modules--news__item a[data-lightbox], .news__wrapper a[data-lightbox]',function(e){var url;e.preventDefault();$activeNewsItem=$(this);that.show($activeNewsItem);url=$activeNewsItem.attr('data-href');$.get(url).done(function(msg){that.addContent(msg)})});$(document).on('click','[data-action="news_load"]',function(e){var $button,url,target,$targetRow,$loader,itemCount,maxItems,DURATION;DURATION=1000;e.preventDefault();$button=$(this);target=$button.attr('data-target');$targetRow=$('[data-row="'+target+'"]');$loader=$('[data-loader="'+target+'"]');itemCount=$targetRow.children().length;maxItems=parseInt($button.attr('data-max-items'),10);url=$button.attr('data-href');if(itemCount<maxItems){$loader.slideDown(DURATION,function(){$.ajax(url,{method:'POST',data:{"tx_vncnews_ajax[offset]":itemCount},success:function(response){var i,$item;for(i=0;i<response.items.length;i++){if((itemCount+i)<maxItems){$item=$(response.items[i].html).hide();$targetRow.append($item)}}},complete:function(){$('[data-item="news"]').slideDown(DURATION);if($targetRow.children().length>=maxItems){$button.parent().slideUp(DURATION)}
$loader.slideUp(DURATION)}})})}})}
function headlineEqualHeight(){$('.news__wrap').each(function(){var height=0;$(this).find('.news__content__headline--equal-height').css('height','').each(function(){height=Math.max(height,$(this).outerHeight())}).css('height',height)})}
var that;that={init:function(){addClickEvents();$(window).on('resize',headlineEqualHeight);headlineEqualHeight()},show:function(){Lightbox.show()},addContent:function(data){Lightbox.appendContent(data,!0)}};return that})();var ObjectFitImages=(function(){var that;that={init:function(){objectFitImages()}};return that})();var Offers=(function(){var that;function addClickEvents(){$(document).on('click','.tiles__content__button--show-more',function(e){e.preventDefault();$(this).slideUp().closest('.tiles').find('.tiles__box').slideDown()})}
that={init:function(){addClickEvents()}};return that})();var Overlay=(function(){var that;function addClickEvents(){$('[data-link-overlay]').on('click',function(){var uid=$(this).data('overlay-uid');that.show(uid)})}
that={init:function(){addClickEvents()},show:function(uid){var overlayContent;if($('#overlay-'+uid+'[data-overlay]').length!==1){console.warn('No content found for overlay '+uid);return}
overlayContent=$('<div>');overlayContent[0].innerHTML=$('#overlay-'+uid+'[data-overlay]')[0].innerHTML;Lightbox.show();Lightbox.appendContent(overlayContent,!0)}}
return that})();$(document).ready(function(e){if($(window).width()<768){if($("#sticky_navigation_mobile").length>0){$('body').css('padding-bottom','50px')}}
if($("#our-innovation-brands").length>0){var mobile_nav=$("#sticky_navigation_mobile");$("#sticky_navigation_mobile").remove();mobile_nav.insertBefore($("#our-innovation-brands"))}
var mobile_height=0;if($(window).width()>768){$("#sticky_navigation").removeClass("start")}
function set_bottom_mobile(){$("#sticky_navigation").removeClass("start");mobile_height=($("#sticky_navigation").height()-48);$("#sticky_navigation_mobile").css("bottom",mobile_height)}
var distance_to_top=$(document).scrollTop();var barrier=$(window).height()/2;var sticky_case=!1;if($(window).width()>768){$("#sticky_navigation").hover(function(){$("#sticky_navigation").addClass("active_hover")},function(){$("#sticky_navigation").removeClass("active_hover")});$("#sticky_navigation").addClass("active_hover");$(window).one("scroll",function(){$("#sticky_navigation").removeClass("active_hover")})}
$(document).on("click","#sticky_navigation_mobile a",function(event){if(!$('#sticky_navigation_mobile').hasClass('active')){event.preventDefault()}else{event.stopPropagation()}});$(document).on("click","#sticky_navigation_mobile li",function(event){if($('#sticky_navigation_mobile').hasClass('active')){triggerLink($(this))}});$(document).on("click","#sticky_navigation a",function(event){event.stopPropagation()});$(document).on("click","#sticky_navigation li",function(event){triggerLink($(this))});function triggerLink($li){var $a,href,target;$a=$li.find('a');href=$a.attr('href');target=$a.attr('target');if(target&&(target!='')&&(target!='_self')){window.open(href)}else{document.location.href=href}}
$(document).on("click","#sticky_navigation_mobile",function(){$("#sticky_navigation").scrollTop(0);if($(this).hasClass("active")){$(this).removeClass("active");$("#sticky_navigation").removeClass("active");$("#sticky_navigation_mobile").removeClass("active")}else{$(this).addClass("active");$("#sticky_navigation").addClass("active");$("#sticky_navigation_mobile").addClass("active")}})});var Video=(function(){var that,VIDEOS,TIMER,$html,$body;function checkAutoPlay(){var viewportTop,viewPortHeight,viewportBottom;viewportTop=Math.max($window.scrollTop(),$document.scrollTop(),$html.scrollTop(),$body.scrollTop());viewPortHeight=$window.height();viewportBottom=viewportTop+viewPortHeight;$.each(VIDEOS,function(){this.checkAutoPlay(viewportTop,viewPortHeight,viewportBottom)})}
TIMER={};VIDEOS=[];$window=$(window);$document=$(document);$html=$('html');$body=$('body');$(document).ready(function(){$('.vnc-video').each(function(){VIDEOS.push(that.activate($(this)))});checkAutoPlay()});$(window).on('scroll',function(){clearTimeout(TIMER.scroll);TIMER.scroll=setTimeout(function(){checkAutoPlay()},300)});that={activate:function($vncVideo){var video,$playPause,playing,autoPlayOnScroll,clicked;function togglePlayPause(){if(playing){video.pause();playing=!1}else{video.play();playing=!0}
$playPause.attr('data-state',playing?'playing':'paused')}
video=$vncVideo.find('video').get(0);$playPause=$vncVideo.find('[data-toggle="play/pause"]');playing=($playPause.attr('data-state')=='playing');clicked=!1;$playPause.on('click',function(){clicked=!0;togglePlayPause()});autoPlayOnScroll=$vncVideo.hasClass('autoplay-on-scroll')&&!$vncVideo.hasClass('autoplay');return{checkAutoPlay:function(viewportTop,viewportHeight,viewportBottom){var top,height,bottom,visible;if(!clicked&&autoPlayOnScroll){top=$vncVideo.offset().top;height=$vncVideo.outerHeight();bottom=top+height;if(viewportHeight<height){visible=((top>=viewportTop)&&(top<viewportBottom))||((bottom<=viewportBottom)&&(bottom>viewportTop))}else{visible=((top>=viewportTop)&&(bottom<=(viewportBottom+0.4*height)))||((bottom<=viewportBottom)&&(top>=(viewportTop-0.4*height)))}
if((visible&&!playing)||(!visible&&playing)){togglePlayPause()}}}}}};return that})();var VolvoMagazine=(function(){var that;function iframeResize(){if($('#magazineFrame').length>0){$(window).on('message',function(event){var data;try{data=JSON.parse(event.originalEvent.data)}catch(ignore){}
if(data&&(data.type=='height')){$('#magazineFrame').height(data.height)}
if(data&&(data.type=='scrollTop')){$("html, body").animate({scrollTop:0},"slow")}
if(data&&(data.type=='page')){location.hash=data.page}});$(window).on('scroll',function(){postData={type:'scroll',top:$(window).scrollTop(),height:$(window).height()};window.frames.magazineFrame.postMessage(JSON.stringify(postData),'*')});$(document).ready(function(){var page;var url;url=$('#magazineFrame').data('url');if(window.location.hash){page=String(window.location.hash).replace('#/','');$('#magazineFrame').attr('src',url+page)}})}}
that={init:function(){iframeResize()}};return that})();var VolvoSelekt=(function(){let that;let $iframe=$(".model-featured-vehicles-iframe");function checkModelIframe(e){let model=e.data('model');let dealer=e.data('dealer');let url=e.data('url');$.getJSON(url,{model:model,dkey:dealer}).done(function(data){if(data.searchResult){$iframe.show()}})}
that={init:function(){if($iframe.length>0){checkModelIframe($iframe)}}};return that})();var Watermark=(function(){var that;that={show:function(){console.log(decodeURIComponent("%0A%0A%0A%09%09-yyyyyyyyhhhhhhys%2B-%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-o%2F%20yMMMd%20%20so-%20%20%20%20%20%20%20%20%0A%09%09%3AyhdMMMMmysssyhNMMMNh%3A%20%20%20%20%20%20%20%20%20%20%60oNMMy%20yMMMd%20%20NMMNo%60%20%20%20%20%20%0A%09%09%20%20%20%20NMMMy%20%20%20%20%20%20%20-yMMMMh%60%20%20%20%20%20%20%20%3ANMMMm-%20sMMMh%20%20%2FNMMMN-%20%20%20%20%0A%09%09%20%20%20%20NMMMy%20%20%20%20%20%20%20%20%20%2FMMMMd%20%20%20%20%20%20-MMMMN%60%20%20oMMMy%20%20%20-MMMMN%60%20%20%20%0A%09%09%20%20%20%20NMMMy%20%20%20%20%20%20%20%20%20%20dMMMM%3A%20%20%20%20%20yMMMMo%20%20%20%2BMMMs%20%20%20%20dMMMMo%20%20%20%0A%09%09%20%20%20%20NMMMy%20%20%20%20%20%20%20%20%20%20yMMMM%2B%20%20%20%20%20mMMMM%2F%20%20%20.%2F%2F%2F-%20%20%20%20hMMMMs%20%20%20%0A%09%09%20%20%20%20NMMMy%20%20%20%20%20%20%20%20%20%20dMMMM-%20%20%20%20%20hMMMMs%20%20%20%20%20%20%20%20%20%20%20%20mMMMM%3A%20%20%20%0A%09%09%20%20%20%20NMMMy%20%20%20%20%20%20%20%20%20%2BMMMMh%20%20%20%20%20%20.NMMMN-%20%20%20%20%20%20%20%20%20%20sMMMMy%20%20%20%20%0A%09%09%20%20%20%20NMMMy%20%20%20%20%20%20%20-yMMMMy%20%20%20%20%20%20%20%20-mMMMNo%60%20%20%20%20%20%20%3AhMMMMo%20%20%20%20%20%0A%09%09%3AyhdMMMMmysssyhNMMMNy-%20%20%20%20%20%20%20%20%20%20%20%2FhMMMMmhhhdNMMMmo.%20%20%20%20%20%20%0A%09%09%2Fyyyyyyyyhhhhhhyo%2F-%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%60%3A%2Bsyhhhyso%2F.%20%20%20%20%20%20%20%20%20%0A%09%09%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%09%09%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%09%09%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%09%09%0A%09%09Die%20Seite%20wurde%20mit%20viel%20Know-how%20und%20Leidenschaft%20von%20Vancado%20%E2%80%93%20digital%20marken%20macher%20umgesetzt.%0A%09%09%0A%09%09Wenn%20Ihr%20Interesse%20%C3%BCber%20den%20Quellcode%20hinaus%20geht%2C%20erreichen%20Sie%20Vancado%20unter%3A%0A%09%09%0A%09%09Fon%20%2B49%20%280%29221%20888%20245-0%0A%09%09info%40vancado.de%0A%09%09www.vancado.de%0A%09%09fb.com%2Fvancado%0A%0A%0A"))}};return that})();var WheelConfigurator=(function(){var that;function iframeInit(){if($('#wheelConfiguratorFrame').length>0){$(window).on('message',function(event){var data;try{data=JSON.parse(event.originalEvent.data)}catch(ignore){}
if(data&&(data.type=='iframeHeight')){$('#wheelConfiguratorFrame').height(data.data.height)}
if(data&&(data.type=='positionUpdate')){$('html, body').animate({scrollTop:$('#wheelConfiguratorFrame').offset().top+data.data.offset},1000)}});$(window).on('scroll',function(){postData={type:'positionUpdate',position:$(window).scrollTop()};window.frames.wheelConfiguratorFrame.postMessage(JSON.stringify(postData),'*')})}}
that={init:function(){iframeInit()}};return that})();var Youtube=(function(){var that,apiLoaded;apiLoaded=!0;$(document).on('click','.vnc-youtube-play',function(){playClick($(this))});$(document).ready(function(){var timer=setInterval(function(){if(window.YT){clearInterval(timer);apiLoaded=!0}})});function playClick($element){if(apiLoaded){playStart($element)}else{setTimeout(function(){playClick($element)},100)}}
function playStart($element){var $lightbox,$frame,$close,video,$videoOverlay,destroyed,name,player,baseRel,playInline;try{baseRel=$element.data('video-ratio-x')/$element.data('video-ratio-y');if(isNaN(baseRel)){baseRel=16/9}}catch(ignore){baseRel=16/9}
destroyed=!1;playInline=($element.attr('data-play-inline')=='parent');if(playInline){$element.closest('.tab-pane').find('img').css({opacity:0})}
$close=$('<div>').addClass('close').attr('data-close','yt-close');$lightbox=$('<div>').addClass('youtube-lightbox '+(playInline?'play-inline':'container')).on('click',function(){hide()});video=document.createElement('div');$videoOverlay=$('<div>').addClass('youtube-frame-overlay').on('click',function(e){e.stopPropagation();playPause()});$frame=$('<div>').addClass('youtube-frame').append(video,$videoOverlay);$lightbox.append($close,$frame);if(playInline){$element.parent().append($lightbox)}else{$('body').append($lightbox)}
$(window).on('resize',function(){var frameRel,w,h;if(!destroyed){$frame.css({width:'',height:'',transition:'none'});frameRel=$frame.width()/$frame.height();if(frameRel>baseRel){h=$frame.height();w=baseRel*h}else{w=$frame.width();h=w/baseRel}
$frame.css({width:w,height:h,marginLeft:-w/2,marginTop:-h/2})}}).trigger('resize');player=new YT.Player(video,{height:'100%',width:'100%',videoId:$element.data('ytid'),host:location.protocol+'//www.youtube.com',playerVars:{autoplay:1,controls:1,rel:0,showinfo:0,modestbranding:1,loop:0,iv_load_policy:3,fs:0,disablekb:1,origin:location.href},events:{onReady:function(event){event.target.playVideo()},onStateChange:function(event){var state=player.getPlayerState();if(state==YT.PlayerState.PLAYING){$videoOverlay.attr('data-play-status','playing')}else if(state==YT.PlayerState.PAUSED){$videoOverlay.attr('data-play-status','paused')}else{$videoOverlay.attr('data-play-status','loading')}
if(state==YT.PlayerState.ENDED){hide();if(playInline){$element.closest('.tab-pane').find('img').css({opacity:1})}}}}});function playPause(){if(player.getPlayerState()==YT.PlayerState.PLAYING){player.pauseVideo()}else{player.playVideo()}}
function hide(){$lightbox.fadeOut(function(){$lightbox.remove();destroyed=!0})}}
that={init:function(){}};return that})();var Headline=(function(){var that;function getContainerChilds(){var $headlines;$headlines=$.makeArray($('.headline-js').eq(0).find('.headline'))}
function setHeight(){$('.headline-js').eq(0).find('.headline')
var maxHeight,$headlines,i;$headlines=$('.headline-js');maxHeight=0;for(i=0;i<$headlines.length;i++){$headlines.eq(i).find('.headline').each(function(){if($(this).height()>maxHeight){maxHeight=$(this).height()}});$headlines.eq(i).find('.headline').height(maxHeight);maxHeight=0}}
that={init:function(){getContainerChilds();setHeight($('.headline-js').eq(0).find('.headline'));if($(window).width>700){getContainerChilds();setHeight($('.headline-js').eq(0).find('.headline'))}},};return that})();$(document).ready(function(){Watermark.show();Navigation.init();Footer.init();ObjectFitImages.init();ImageGallery.init();ContentElements.init();News.init();Event.init();Offers.init();VolvoMagazine.init();WheelConfigurator.init();GoogleMaps.init();Information.init();Headline.init();Accordion.init();VolvoSelekt.init();Overlay.init();ContactItemLinks.init();IframeScroll.init()})