(function($){"use strict";$('.toc a[href*=#]:not([href=#])').click(function(){if(location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'')&&location.hostname==this.hostname){var target=$(this.hash);target=target.length?target:$('[name='+this.hash.slice(1)+']');if(target.length){$('html,body').animate({scrollTop:target.offset().top},400);return false;}}});var slideshows=$('.slideshow-gallery .cycle-slideshow').on('cycle-next cycle-prev',function(e,opts){slideshows.not(this).cycle('goto',opts.currSlide);});$('.slideshow-thumbs li').click(function(){var index=$('.slideshow-thumbs .cycle-slideshow').data('cycle.API').getSlideIndex(this);slideshows.cycle('goto',index);return false;});$('.cycle-slideshow').each(function(){var cycle=$(this),controls=cycle.closest('.catalog-carousel');cycle.cycle({next:controls.find('.cycle-next'),prev:controls.find('.cycle-prev'),log:false});});$('.gallery-grid').each(function(){$(this).magnificPopup({delegate:'a.isPopup',type:'image',gallery:{enabled:true}});});if($('.toc').length>0&&$('.secondary-nav').length>0){$('.secondary-nav .secondblock .container').append($('.toc ul').addClass('tertiary-nav').clone());};var wrap=$(".secondary-nav");var viewportElements=[];var viewportElementspos=[];var wh=0;var windowHeight=function(e){wh=$(window).height()/2;};var viewportSearch=function(e){viewportElements=[];viewportElementspos=[];$('.secondary-nav .secondblock a').each(function(e){var el=$(this).attr('href');viewportElements.push(el);viewportElementspos.push(parseInt($(el).position().top-($(el).css('padding-top').replace('px','')/2)));});} $(window).on("resize",function(e){windowHeight();viewportSearch();});viewportSearch();var pStick=$(".primary-nav");$(window).on("scroll",function(e){if(document.cookie.indexOf('sc_mode=edit')==-1&&document.cookie.indexOf('sc_mode=preview')==-1){var wpos=$(window).scrollTop();if(wpos>124){pStick.addClass("stick");var nBanner=$('.top-notification-banner');if(nBanner.length==1){if(nBanner.is(':visible')){$(".primary-nav.stick").css('top',nBanner.outerHeight());}}}else{pStick.removeClass("stick");} var stoper=0;for(var i=0;iviewportElementspos[i]-wh){stoper=i;}}}});$('.top-notification-banner .notification-close').click(function(e){e.preventDefault();var date=new Date($(this).data('expiry'));var _path="/;sameSite=Strict;secure";document.cookie=$(this).data('cookie')+'=true; expires='+date.toUTCString()+'; path='+_path;$('.top-notification-banner').slideUp();$(".primary-nav.stick").animate({top:'0'},'fast','linear');});$(window).on("scroll",function(e){var wpos=$(window).scrollTop();if(wpos>124){wrap.addClass("stick");}else{wrap.removeClass("stick");} var stoper=0;$('.secondary-nav .secondblock a').parent().removeClass('active');for(var i=0;iviewportElementspos[i]-wh){stoper=i;}} $('.secondary-nav.stick .secondblock a[href='+viewportElements[stoper]+']').parent().addClass('active');});var loadvideo=function(videoUrl,videoFormat){if(videoFormat==='HTML5'){$('.videostage .stage').html('');$(".videostage video").attr({"src":videoUrl,"autoplay":"autoplay",});}else{$('.videostage .stage').html('