­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ (function($,undefined){"use strict";$us.PageScroller=function(container,options){this.init(container,options)};$us.PageScroller.prototype={init:function(container,options){var defaults={coolDown:100,animationDuration:1000,animationEasing:$us.getAnimationName('easeInOutExpo'),endAnimationEasing:$us.getAnimationName('easeOutExpo')};this.options=$.extend({},defaults,options);this.$container=$(container);this._canvasTopOffset=$us.$canvas.offset().top;this.activeSection=0;this.sections=[];this.initialSections=[];this.hiddenSections=[];this.currHidden=[];this.dots=[];this.scrolls=[];this.usingDots=!1;this.footerReveal=$us.$body.hasClass('footer_reveal');this.isTouch=(('ontouchstart' in window)||(navigator.msMaxTouchPoints>0)||(navigator.maxTouchPoints));this.disableWidth=(this.$container.data('disablewidth')!==undefined)?this.$container.data('disablewidth'):768;this.hiddenClasses={'uvc_hidden-xs':[0,479],'uvc_hidden-xsl':[480,767],'uvc_hidden-sm':[768,991],'uvc_hidden-md':[992,1199],'uvc_hidden-ml':[1200,1823],'uvc_hidden-lg':[1824,99999],'vc_hidden-xs':[0,767],'vc_hidden-sm':[768,991],'vc_hidden-md':[992,1199],'vc_hidden-lg':[1200,99999]};if(this.$container.data('speed')!==undefined){this.options.animationDuration=this.$container.data('speed')} this._attachEvents();this._events={scroll:this.scroll.bind(this),resize:this.resize.bind(this)};$us.$canvas.on('contentChange',$us.debounce(this._events.resize,5));$us.$window.on('resize',function(e,stop){if(stop!==undefined){$us.debounce(this._events.resize,5)}}.bind(this));$us.$window.on('scroll',$us.debounce(this._events.scroll,5));$us.timeout(this._init.bind(this),100);this.headerHeight=0;$us.header.on('transitionEnd',function(header){this.headerHeight=header.getCurrentHeight()-header.getAdminBarHeight()}.bind(this))},is_popup:function(){return $us.$html.hasClass('usoverlay_fixed')},_init:function(){if($us.canvas.headerPos==='static'&&$us.header.isHorizontal()&&!$us.header.isTransparent()){$us.canvas.$header.each(function(){var $section=$us.canvas.$header,section={$section:$section,area:'header',};this._countPosition(section);this.sections.push(section);this.initialSections.push(section)}.bind(this))} $us.$canvas.find('> *:not(.l-header) .l-section').each(function(key,elm){if($('.l-section',elm).length){return} var $section=$(elm),section={$section:$section,hiddenBoundaries:[],area:'content',isSticky:$section.hasClass('type_sticky')},addedWidths=[];hidden:for(var i in this.hiddenClasses){if(this.hiddenClasses.hasOwnProperty(i)){var low=this.hiddenClasses[i][0],high=this.hiddenClasses[i][1];if($section.hasClass(i)){var addedWidthLength=addedWidths.length,j;addedWidths.push([low,high]);for(j=0;j .l-section').each(function(key,elm){var $section=$(elm),section={$section:$section,area:'footer',isSticky:$section.hasClass('type_sticky')};this._countPosition(section,key);this.sections.push(section);this.initialSections.push(section)}.bind(this));this.$dotsContainer=this.$container.find('.w-scroller-dots');if(this.$dotsContainer.length){this.usingDots=!0;this.$firstDot=this.$dotsContainer.find('.w-scroller-dot').first();this.redrawDots(!0);this.scroll()}},isSectionHidden:function(section){if(!this.initialSections[section].hiddenBoundaries||!this.initialSections[section].hiddenBoundaries.length){return!1} var currWidth=window.innerWidth,isHidden=!1;for(var i=0;i=low&&currWidth<=high){isHidden=!0;break}} return isHidden},redrawDots:function(inited){if(!this.$dotsContainer.length||!this.usingDots){return!1} this.$dotsContainer.html('');for(var i=0;i$us.canvas.options.columnsStackingWidth)}.bind(this));if(!!inited){this.dots[this.activeSection].addClass('active')} this.$dotsContainer.addClass('show')},recountSections:function(){if(this.currHidden){for(var initialSection in this.initialSections){this.sections[initialSection]=this.initialSections[initialSection]}} for(var i=this.hiddenSections.length-1;i>=0;i --){var indexOfTheItem=this.currHidden.indexOf(this.hiddenSections[i]);if(this.isSectionHidden(this.hiddenSections[i])){if(indexOfTheItem===-1){this.currHidden.push(this.hiddenSections[i])} this.sections.splice(this.hiddenSections[i],1)}else{this.currHidden.splice(indexOfTheItem,1)}} this.redrawDots()},getScrollSpeed:function(number){var sum=0,lastElements=this.scrolls.slice(Math.max(this.scrolls.length-number,1));for(var i=0;i149){that.scrolls.shift()} that.scrolls.push(Math.abs(direction));if((currentTime-that.previousMouseWheelTime)>that.options.coolDown){that.scrolls=[]} that.previousMouseWheelTime=currentTime;speedEnd=that.getScrollSpeed(10);speedMiddle=that.getScrollSpeed(70);isAccelerating=speedEnd>=speedMiddle;if(isAccelerating){if(direction<0){target ++}else if(direction>0){target --} if(that.sections[target]===undefined){return} that.scrollTo(target);that.lastScroll=currentTime}} $us.$document.off('mousewheel DOMMouseScroll MozMousePixelScroll');document.removeEventListener('mousewheel',mouseWheelHandler);document.removeEventListener('DOMMouseScroll',mouseWheelHandler);document.removeEventListener('MozMousePixelScroll',mouseWheelHandler);$us.$canvas.off('touchstart touchmove');if($us.$window.width()>this.disableWidth&&$us.mobileNavOpened<=0&&(!$us.$html.hasClass('cloverlay_fixed'))){document.addEventListener('mousewheel',mouseWheelHandler,{passive:!1});document.addEventListener('DOMMouseScroll',mouseWheelHandler,{passive:!1});document.addEventListener('MozMousePixelScroll',mouseWheelHandler,{passive:!1});if($.isMobile||this.isTouch){$us.$canvas.on('touchstart',function(event){var e=event.originalEvent;if(typeof e.pointerType==='undefined'||e.pointerType!=='mouse'){this.touchStartY=e.touches[0].pageY}}.bind(this));$us.$canvas.on('touchmove',function(event){event.preventDefault();var currentTime=new Date().getTime(),e=event.originalEvent,target=this.activeSection;this.touchEndY=e.touches[0].pageY;if(Math.abs(this.touchStartY-this.touchEndY)>($us.$window.height()/50)){if(this.touchStartY>this.touchEndY){target ++}else if(this.touchEndY>this.touchStartY){target --} if(this.sections[target]===undefined){return} this.scrollTo(target);this.lastScroll=currentTime}}.bind(this))}}},_countPosition:function(section,key){section.top=section.$section.offset().top-this._canvasTopOffset;if(this.footerReveal&§ion.area==='footer'&&key!==undefined){if(window.innerWidth>parseInt($us.canvasOptions.columnsStackingWidth)-1){if(this.sections[key-1]!==undefined&&this.sections[key-1].area==='footer'){section.top=this.sections[key-1].bottom}else{var rowIndex=(this.sections[this.lastContentSectionIndex+key]!==undefined)?this.lastContentSectionIndex+key:key-1;section.top=this.sections[rowIndex].bottom}}} section.bottom=section.top+section.$section.outerHeight(!1)},_countAllPositions:function(){var counter=0;for(var section in this.sections){if(this.sections[section].$section.length){this._countPosition(this.sections[section],counter)} counter ++}},scrollTo:function(target){var currentTime=new Date().getTime();if(this.previousScrollTime!==undefined&&(currentTime-this.previousScrollTime$us.canvas.options.columnsStackingWidth){if(target>this.activeSection){target+=1}else{target-=1}} if(this.usingDots){this.$dots.removeClass('active');if(this.dots[target]!==undefined){this.dots[target].addClass('active')}} var top=parseInt(this.sections[target].top||0);if(top===$us.header.getScrollTop()){return} var animateOptions={duration:this.options.animationDuration,easing:this.options.animationEasing,start:function(){this.isScrolling=!0}.bind(this),always:function(){this.isScrolling=!1;this.activeSection=target}.bind(this),step:function(now,fx){var newTop=top;if($us.header.isStickyEnabled()){newTop-=this.headerHeight} if(fx.end!==newTop){$us.$htmlBody.stop(!0,!1).animate({scrollTop:newTop},$.extend(animateOptions,{easing:this.options.endAnimationEasing}))}}.bind(this)};$us.$htmlBody.stop(!0,!1).animate({scrollTop:top},animateOptions)},resize:function(e){if(this.is_popup()){return!1} this._attachEvents();this.recountSections();$us.timeout(this._countAllPositions.bind(this),150)},scroll:function(){if(this.is_popup()){return!1} var currentTime=new Date().getTime();if((currentTime-this.lastScroll)<(this.options.coolDown+this.options.animationDuration)){return} $us.debounce(function(){var scrollTop=parseInt($us.$window.scrollTop()||0);if($us.header.isSticky()){scrollTop+=$us.header.getCurrentHeight()} for(var index in this.sections){var section=this.sections[index];if(scrollTop>=parseInt(section.top-1)&&scrollTop