window.inAction=1;window.allowSlide=1;window.blockScroll=1;window.direction="";window.effectOffset=0;window.slideSpeed=1000;window.cleanupDelay=1450;window.effectSpeed=800;window.horizontalMode=0;window.sidebarShown=0;window.loadingProgress=0;window.customScroll=1;window.scrollSpeed=700;window.preload=1;window.setHashLink=1;window.hideSidebarOnBodyClick=1;var $html=$('html');window.isMobile=false;if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){window.isMobile=true;} if(window.isMobile){$html.addClass('mobile');} window.isFirefox=navigator.userAgent.toLowerCase().indexOf('firefox')>-1;window.isSafari=/^((?!chrome).)*safari/i.test(navigator.userAgent);window.isChrome=/chrom(e|ium)/.test(navigator.userAgent.toLowerCase());window.isChromeiOS=navigator.userAgent.match('CriOS');window.isMSIE=navigator.userAgent.match('MSIE');window.isAndroid=navigator.userAgent.toLowerCase().indexOf("android")>-1;window.isiPad=navigator.userAgent.match(/iPad/i)!==null;window.isWindows=navigator.platform.toUpperCase().indexOf('WIN')!==-1;window.isOSX=navigator.platform.toUpperCase().indexOf('MAC')!==-1;window.isLinux=navigator.platform.toUpperCase().indexOf('LINUX')!==-1;if(window.isSafari){$html.addClass('safari');} if(window.isFirefox){$html.addClass('firefox');} if(window.isChrome){$html.addClass('chrome');} if(window.isMSIE){$html.addClass('msie');} if(window.isAndroid){$html.addClass('android');} if(window.isWindows){$html.addClass('windows');} if(window.isOSX){$html.addClass('osx');} if(window.isLinux){$html.addClass('linux');} window.isRetina=((window.matchMedia&&(window.matchMedia('only screen and (min-resolution: 124dpi), only screen and (min-resolution: 1.3dppx), only screen and (min-resolution: 48.8dpcm)').matches||window.matchMedia('only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3)').matches))||(window.devicePixelRatio&&window.devicePixelRatio>1.3));if(window.isRetina){$html.addClass('retina');} $(document).ready(function(){"use strict";var $body=$('body');setTimeout(function(){$(window).trigger('ready');},1);$body.hide().show(0);if(window.isChromeiOS||$body.hasClass('simplifiedAndroid')){$body.addClass('simplifiedMobile');} $html.addClass('page-ready');if($body.hasClass('fast')){window.slideSpeed=600;window.cleanupDelay=1200;window.effectSpeed=600;window.scrollSpeed=400;}else if($body.hasClass('slow')){window.slideSpeed=1400;window.cleanupDelay=2000;window.effectSpeed=1000;window.scrollSpeed=1000;} window.stage=1;window.stages=$('.slide').size();window.isScroll=$body.hasClass('scroll');window.isSimplifiedMobile=$body.hasClass('simplifiedMobile');if(window.isScroll||window.isSimplifiedMobile&&window.isMobile){$html.addClass('scrollable');} if($body.hasClass('horizontal')){window.horizontalMode=1;} if($body.hasClass('noPreload')){window.preload=0;} if($body.hasClass('animated')){window.animated=1;} if($body.hasClass('defaultScroll')){window.customScroll=0;} function updateHash(){var isHash=window.location.href.split("#")[1];if((isHash)&&($('.slide[name="'+isHash+'"]').length>0)){var requestedElement=$('.slide[name="'+isHash+'"]');if((window.isMobile&&window.isSimplifiedMobile)||window.isScroll){if(requestedElement.length){if(!window.preload){$('html,body').stop().clearQueue().animate({scrollTop:requestedElement.position().top},window.effectSpeed);}else{$(window).load(function(){$('html,body').stop().clearQueue().animate({scrollTop:requestedElement.position().top},window.effectSpeed);});}}}else{window.stage=$('.slide').index(requestedElement)+1;if(window.loaded){showSlide(window.stage);}}}else{$body.addClass('firstSlide stage-1');}} updateHash();$(window).on('popstate',function(e){setTimeout(function(){updateHash();},100);e.preventDefault();});var isHash=window.location.href.split("#")[1];if((window.debugMode)&&(!isNaN(isHash))){window.stage=Number(isHash);} if(window.preload){var imgs=[];$("*").each(function(){if($(this).css("background-image")!=="none"){imgs.push($(this).css("background-image").replace(/.*\s?url\([\'\"]?/,'').replace(/[\'\"]?\).*/,''));}else if($(this).is('img')){imgs.push($(this).attr("src"));}});window.images=imgs.length;$.cacheImage(imgs,{complete:function(){window.loadingProgress++;}});var loadingInterval=setInterval(function(){var progress=45*(window.loadingProgress/window.images);$('.loadingIcon .dash').attr('stroke-dasharray',progress+',100');$('.loadingIcon').redraw();if(window.loaded){$('.loadingIcon .dash').attr('stroke-dasharray','100,100');clearInterval(loadingInterval);}},400);} $(window).load(function(){$('.grid.masonry').masonry({itemSelector:'li',transitionDuration:'0.1s'});});showSlide(window.stage);if(!window.preload){runTheCode();}else{$(window).load(function(){runTheCode();});} function runTheCode(){$html.addClass('page-loaded');window.inAction=0;window.loaded=1;window.blockScroll=0;setTimeout(function(){if(window.isScroll){updateScroll();updateNavigation();}if(window.isMobile&&window.isSimplifiedMobile){$('.slide').addClass('selected animate active');updateNavigation();}else{showSlide(window.stage);}},500);} function showSlide(requested){requested=parseInt(requested);if(window.isMobile&&window.isSimplifiedMobile||window.isScroll){return;} updateNavigation();var newSlide=$('.slide').eq(requested-1),currenSlide=$('.slide.selected'),currenSlideIndex=currenSlide.index('.slide')+1;hideShare();unzoomImage();hideSidebar();window.allowSlide=1;$html.removeClass('sidebarShown');$body.removeClass('sidebarShown lastSlide firstSlide');if(window.stage===1){$body.addClass('firstSlide');} if((window.stages===window.stage)&&(window.stages!==1)){$body.addClass('lastSlide');} $body.removeClassByPrefix("stage-").addClass('stage-'+window.stage);if(newSlide.hasClass('whiteSlide')){$body.addClass('whiteSlide');}else{$body.removeClass('whiteSlide');} if(currenSlideIndex!==requested){currenSlide.removeClass('selected').removeClass(window.direction).addClass('active');newSlide.removeClass('before after').addClass('selected active').addClass(window.direction);newSlide.prevAll('.slide').addClass('before').removeClass('after');newSlide.nextAll('.slide').addClass('after').removeClass('before');$(window).trigger("slideChange",[parseInt(requested),newSlide]);} if(window.setHashLink){if(newSlide.attr('name')){window.location.hash=newSlide.attr('name');}else{if((window.location.toString().indexOf('#')>0)&&(location.protocol!=="file:")&&(location.href.split('#')[0])){if(history.pushState){window.history.pushState("","",location.href.split('#')[0]);}else{window.location.hash="";}}}} newSlide.find('.content').scrollTop(0);if(window.loaded){window.blockScroll=1;setTimeout(function(){if(currenSlideIndex!==requested){currenSlide.removeClass('active animate');} window.blockScroll=0;},window.slideSpeed);if(window.effectOffset>window.slideSpeed){window.effectOffset=window.slideSpeed;} setTimeout(function(){newSlide.addClass('animate');},window.slideSpeed-window.effectOffset);$('.done').removeClass('done');clearTimeout(window.clearElementAnimation);window.clearElementAnimation=setTimeout(function(){$(".slide.selected [class*='ae-']").addClass('done');},window.slideSpeed+window.effectSpeed+window.cleanupDelay);} if(window.debugMode){window.location.hash=requested;}} $(".animated").on("click","[class*='ae-']:not('.done')",function(){$(this).addClass('done');});window.changeSlide=function(n){if(n==="increase"){if((window.stage+1)>=window.stages){n=window.stages;}else{n=window.stage+1;}}else if(n==="decrease"){if((window.stage-1)<1){n=1;}else{n=window.stage-1;}} if(window.isMobile&&window.isSimplifiedMobile||window.isScroll){window.stage=n;var requestedElement=$('.slide:eq('+(window.stage-1)+')'),offsetTop=$(requestedElement).offset().top,scrollTop=$(document).scrollTop(),finalPosition=(window.isMobile)?offsetTop+scrollTop:offsetTop;$('html,body').stop().clearQueue().animate({scrollTop:finalPosition},1000);}else{if(n!==window.stage){if(window.inAction!==1){window.inAction=1;window.stage=n;showSlide(window.stage);setTimeout(function(){window.inAction=0;},window.slideSpeed);}}}};$('.nextSlide').on('mouseup touchstart',function(){window.changeSlide('increase');});$('.prevSlide').on('mouseup touchstart',function(){window.changeSlide('decrease');});$('.toFirstSlide').on('mouseup touchstart',function(){window.changeSlide(1);if(history.pushState){window.history.pushState("","",location.href.split('#')[0]);}else{window.location.hash="";} if(window.isMobile){hideSidebar();}});$('.toLastSlide').on('mouseup touchstart',function(){window.changeSlide(window.stages);if(history.pushState){window.history.pushState("","",location.href.split('#')[0]);}else{window.location.hash="";} if(window.isMobile){hideSidebar();}});$('[class*="toSlide-"]').on('mouseup touchstart',function(){var num=$(this).attr('class').replace(/[^0-9]/g,'');window.changeSlide(num);if(window.isMobile){hideSidebar();}});function unzoomImage(){if($('.zoom-overlay-open').length>0){setTimeout(function(){$('.zoom-img').click();},window.slideSpeed);}} $('html,body').on('mousewheel',function(event){var currentSection=$('.slide.selected .content'),scrollsize=Math.abs(Math.round(event.deltaY)),minScrollSize=(window.isFirefox)?8:40,browserScrollRate=(window.isFirefox)?6.88:1,OSScrollRate=(window.isWindows)?browserScrollRate*2:browserScrollRate,wheelDelta=(event.originalEvent.wheelDelta)?event.originalEvent.wheelDelta:event.deltaY*event.deltaFactor,energy=wheelDelta*browserScrollRate*OSScrollRate,scrollDirection=(event.deltaY>=0)?"up":"down",curSecScrolltop=$(currentSection).scrollTop(),currentSectionHeight=$(currentSection).find('.container').outerHeight(),deviceZoom=detectZoom.device();if((window.isWindows)||(window.isLinux)){minScrollSize=1;scrollsize=Math.abs(event.deltaY)*event.deltaFactor;} if((window.isMobile&&window.isSimplifiedMobile)||window.isScroll){if((!window.sidebarShown)&&(!window.popupShown)&&(!window.blockScroll)){if(window.customScroll){event.preventDefault();if(energy>1500){energy=1500;} if(energy<-1000){energy=-1500;} var scrollObject=$(window),scrollTop=scrollObject.scrollTop(),finalScroll=scrollTop-energy;TweenLite.to(scrollObject,window.scrollSpeed/1000,{scrollTo:{y:finalScroll,autoKill:false},ease:Power1.easeOut,overwrite:5});}else{if(!window.isWindows){$(currentSection).scrollTop(curSecScrolltop-energy);}}}} if(!window.isScroll){if((currentSectionHeight>$(window).height())){window.allowSlide=0;if((scrollDirection==="up")&&($(currentSection).scrollTop()===0)){window.allowSlide=1;}else if((scrollDirection==="down")&&($(currentSection).scrollTop()+$(window).height()>=Math.floor(currentSectionHeight/deviceZoom))){window.allowSlide=1;} if((!window.sidebarShown)&&(!window.popupShown)&&(!window.blockScroll)){if(window.customScroll){event.preventDefault();if(energy>1500){energy=1500;} if(energy<-1000){energy=-1500;} TweenLite.to(currentSection,0.5,{scrollTo:{y:curSecScrolltop-energy,autoKill:false},ease:Power1.easeOut,overwrite:5});}else{if(!window.isWindows){curSecScrolltop=(scrollDirection==="up")?curSecScrolltop-scrollsize:curSecScrolltop+scrollsize;$(currentSection).scrollTop(curSecScrolltop);}}}} if((scrollsize>=minScrollSize)&&(window.allowSlide)&&(!window.sidebarShown)&&(!window.popupShown)&&(!window.disableOnScroll)){if((scrollDirection==="down"&&window.stage!==window.stages)||(scrollDirection==="up"&&window.stage!==1)){if(window.inAction!==1){window.inAction=1;if(scrollDirection==="down"){window.stage++;}else if(scrollDirection==="up"){window.stage--;} if(window.stage>window.stages){window.stage=window.stages;}else if(window.stage<1){window.stage=1;} showSlide(window.stage);setTimeout(function(){window.inAction=0;},window.slideSpeed);}}}}});$(window).on('scroll',function(){if((window.isMobile&&window.isSimplifiedMobile)||window.isScroll){updateScroll();}});var hideShareonScrollDelay=0;function updateScroll(){hideShareonScrollDelay++;if(hideShareonScrollDelay>=6){hideShare();hideShareonScrollDelay=0;} $('.slide').each(function(index,element){var $element=$(element),scrollTop=$(document).scrollTop(),positionY=(window.isMobile)?$(element).offset().top+scrollTop:$(element).offset().top,elementHeight=$element.height(),windowHeight=$(window).height(),documentHeight=$(document).height(),halfWay=(windowHeight/2>elementHeight)?elementHeight/2:windowHeight/2,halfOnScreen=((positionY<(windowHeight+scrollTop-halfWay))&&(positionY>(scrollTop-elementHeight+halfWay))),scale=(scrollTop-positionY)/windowHeight,allowToSelect=true;if(scrollTop===0){if(index===0){allowToSelect=true;}else{allowToSelect=false;}} if(scrollTop+windowHeight===documentHeight){if(index===window.stages-1){allowToSelect=true;}else{allowToSelect=false;}} if(halfOnScreen&&allowToSelect){$element.addClass('selected animate active');if(window.stage!==$element.index('.slide')+1){window.stage=$element.index('.slide')+1;$(window).trigger("slideChange",[window.stage,$element]);}if(!window.firstTimeTrigger){window.firstTimeTrigger=1;$(window).trigger("slideChange",[window.stage,$element]);} if(window.stage===1){$body.addClass('firstSlide');}else{$body.removeClass('firstSlide');} if(window.stages===window.stage){$body.addClass('lastSlide');}else{$body.removeClass('lastSlide');} $body.removeClassByPrefix("stage-").addClass('stage-'+window.stage);if($element.hasClass('whiteSlide')){$body.addClass('whiteSlide');}else{$body.removeClass('whiteSlide');} window.clearElementAnimation=setTimeout(function(){$element.find("[class*='ae-']").addClass('done');},window.effectSpeed+window.cleanupDelay);updateNavigation();}else{$element.removeClass('selected');} if(scale>-1&&scale<1){if($element.hasClass('parallax')){var precentage=100-((scale/2)+0.5)*100;$element.find('.background').css('-webkit-transform-origin',"50% "+precentage+"%").css('transform-origin',"50% "+precentage+"%");}}});} $('.mobile .slides:not(.scroll):not(.simplifiedMobile)').swipe({swipeStatus:function(event,phase,direction,distance){window.allowSwipeUp=1;window.allowSwipeDown=1;var currentSection=$('.slide.selected .content'),currentSectionHeight=$(currentSection).find('.container').outerHeight(),next="up",prev="down",minDistanceMobile=30,windowHeight=window.innerHeight;if(window.sidebarShown){currentSection=$('.sidebar .content');} if(window.popupShown){currentSection=$('.popup .content');} if(phase==="start"){window.scrollTop=$(currentSection).scrollTop();} if(window.horizontalMode){next="left";prev="right";} if((!window.horizontalMode)&&(currentSectionHeight>windowHeight)){if(window.scrollTop+windowHeight0){window.allowSwipeDown=0;}} if(!window.sidebarShown){if(window.horizontalMode){if(direction===next&&distance>minDistanceMobile){window.changeSlide('increase');}else if(direction===prev&&distance>minDistanceMobile){window.changeSlide('decrease');}}else{if(direction===next&&distance>minDistanceMobile&&window.allowSwipeUp&&window.allowSlide){window.changeSlide('increase');}else if(direction===prev&&distance>minDistanceMobile&&window.allowSwipeDown&&window.allowSlide){window.changeSlide('decrease');}}}},maxTimeThreshold:30,fingers:'all',allowPageScroll:"vertical"});if($('.panel .compact').length>0){$('.panel .compact').each(function(index,element){var panel=$(element).parents('.panel'),desktop=$(panel).find('.desktop'),compact=element,forceMobileView=$(panel).hasClass('forceMobileView');$(window).on('load resize ready',function(){var documentWidth=$(document).width(),panelsPadding=parseInt($(panel).css('padding-left').replace('px',''))+parseInt($(panel).css('padding-right').replace('px',''));if((window.isMobile||$(document).width()<767)&&forceMobileView){$(desktop).addClass('hidden');$(compact).removeClass('hidden');}else{$(desktop).removeClass('hidden');$(compact).addClass('hidden');var totalWidth=0;desktop.children().each(function(){if($(this).outerWidth()>$(this).children().outerWidth()){totalWidth+=Math.round($(this).outerWidth());}else{totalWidth+=Math.round($(this).children().outerWidth());}});if((totalWidth+Math.round(panelsPadding)>documentWidth+2)||((window.isMobile||documentWidth<767)&&forceMobileView)){$(desktop).addClass('hidden');$(compact).removeClass('hidden');}else{$(desktop).removeClass('hidden');$(compact).addClass('hidden');}}});});} if(($('.panel.hideOnScroll').length>0)&&(window.isScroll||window.isSimplifiedMobile)){var lastScrollTop,i=0,sensitivity=20,panelToHide=$('.panel.hideOnScroll');$(window).scroll(function(){var scrollTop=$(this).scrollTop(),windowHeight=$(window).height(),documentHeight=$(document).height(),$panelToHide=$(panelToHide);if(scrollTop>lastScrollTop){i++;if(i>=sensitivity){$panelToHide.addClass('hide');i=sensitivity;}}else{i-=1;if(i<=sensitivity/2){i=0;$panelToHide.removeClass('hide');}} lastScrollTop=scrollTop;if((scrollTop+windowHeight+sensitivity>=documentHeight)||(scrollTop+sensitivity<=0)){$panelToHide.removeClass('hide');}});} $(window).on("keydown",function(e){var delta=2.5,scrollTime=0.5,scrollDistance=50,currentSection=$('.slide.selected .content'),scrollTop=$(currentSection).scrollTop(),finalScroll=scrollTop+parseInt(delta*scrollDistance);if(e.keyCode===37){e.preventDefault();if(window.horizontalMode){window.changeSlide('decrease');}} if(e.keyCode===38){if(!window.horizontalMode){e.preventDefault();window.changeSlide('decrease');}else{e.preventDefault();TweenLite.to($(currentSection),scrollTime,{scrollTo:{y:finalScroll,autoKill:true},ease:Power1.easeOut,overwrite:5});}} if(e.keyCode===39){if(window.horizontalMode){e.preventDefault();window.changeSlide('increase');}} if(e.keyCode===40){if(!window.horizontalMode){e.preventDefault();window.changeSlide('increase');}else{e.preventDefault();TweenLite.to($(currentSection),scrollTime,{scrollTo:{y:finalScroll,autoKill:true},ease:Power1.easeOut,overwrite:5});}} if(e.keyCode===27){hideSidebar();hideShare();hidePopup();unzoomImage();}});var navParent=$('.navigation'),navigation=$(navParent).find('ul');if($(navigation).length>0){if($(navigation).is(':empty')){$(navigation).each(function(index,element){for(var i=1;i<=window.stages;i++){var title=$('.slide:eq('+(i-1)+')').data('title');if(title===undefined){if(window.debugMode){$(element).append('
  • ');}else{$(element).append('
  • ');}}else{$(element).append('
  • ');}}});} $('.navigation li').on("click touchend",function(){window.changeSlide($(this).index()+1);});if(!$('.side').hasClass('compact')){$(window).on('load resize ready',function(){var containerWidth=$(window).height()-$(window).width()*0.1112-100,container=$('.side').removeClass('compact').find('ul'),totalWidth=0;$(container).children().each(function(){if($(this).outerWidth()>$(this).children().outerWidth()){totalWidth+=Math.round($(this).outerWidth());}else{totalWidth+=Math.round($(this).children().outerWidth());}});if(totalWidth>containerWidth){$('.side').addClass('compact');}else{$('.side').removeClass('compact');}});}} $("a[href^='#'][target!='_blank']").click(function(e){e.preventDefault();var url=$(this).attr('href'),hashLink=url.split('#')[1];if(hashLink&&$('.slide[name="'+hashLink+'"]').length>0){var requestedElement=$('.slide[name="'+hashLink+'"]');if(window.isMobile&&window.isSimplifiedMobile||window.isScroll){var target=requestedElement;if(target.length){$('html,body').stop().clearQueue().animate({scrollTop:target.position().top},1000);} if(window.setHashLink){window.location.hash=hashLink;}}else{window.stage=$('.slide').index(requestedElement)+1;showSlide(window.stage);} if(window.isMobile){hideSidebar();}}});function updateNavigation(){setTimeout(function(){if($(navigation).length>0){$(navigation).each(function(index,element){$(element).find('li.selected').removeClass('selected');$(element).find('li').eq(window.stage-1).addClass('selected');});}},100);} $('.sidebarTrigger[data-sidebar-id]').on('click',function(){var sidebarID=$(this).data('sidebar-id'),element=$('.sidebar[data-sidebar-id="'+sidebarID+'"]'),isAnimated=$(element).hasClass('animated');if(!window.sidebarShown){if(element.length>0){window.sidebarShown=1;window.allowSlide=0;$(element).removeClass('animate active').addClass('visible');$html.addClass('sidebarShown');$(element).find('.content').scrollTop(0);if(isAnimated){clearTimeout(window.removeAnimationTimeout);setTimeout(function(){$(element).addClass('animate active');},100);}}}else{hideSidebar();} hideShare();});function hideSidebar(){if(window.sidebarShown){$html.removeClass('sidebarShown');var $sidebar=$('.sidebar.visible');$sidebar.removeClass('visible');window.removeAnimationTimeout=setTimeout(function(){$sidebar.removeClass('animate active');},500);window.sidebarShown=0;window.allowSlide=1;}} $(document).on('mouseup touchstart',function(e){var container=$(".sidebarShown .sidebar, .dropdownTrigger");if(!container.is(e.target)&&container.has(e.target).length===0&&window.hideSidebarOnBodyClick){hideSidebar();}});$('.sidebar .close').on('click touchstart',function(){hideSidebar();});$('.popupTrigger').on('click',function(){var sidebarID=$(this).data('popup-id'),element=$('.popup[data-popup-id="'+sidebarID+'"]'),isAnimated=element.hasClass('animated');if(element.length>0){$(element).addClass('visible');if(isAnimated){setTimeout(function(){$(element).addClass('animate active');clearTimeout(window.clearPopupElementAnimation);window.clearPopupElementAnimation=setTimeout(function(){$(element).find("[class*='ae-']").addClass('done');},window.effectSpeed+window.cleanupDelay);},100);} $html.toggleClass('popupShown');$(element).scrollTop(0);window.allowSlide=0;window.popupShown=1;if($(element).hasClass('autoplay')){var $element=$(element),iframe=$element.find('iframe'),HTML5video=$element.find('video');if(iframe.length>0){var iframeSrc=$(iframe).attr('src'),symbol=(iframeSrc.indexOf('?')>-1)?"&":"?";$(iframe).attr('src',iframeSrc+symbol+"autoplay=1");}else if(HTML5video.length>0){$(HTML5video)[0].play();}}} hideShare();});function hidePopup(){if(window.popupShown){var element=$('.popup.visible'),iframe=$(element).find('iframe'),HTML5video=$(element).find('video');if(iframe.length>0){var iframeSrc=$(iframe).attr('src'),symbol=(iframeSrc.indexOf('?autoplay')>-1)?"?":"&";$(iframe).attr('src',$(iframe).attr('src').replace(symbol+'autoplay=1',''));}else if(HTML5video.length>0){$(HTML5video)[0].pause();$(HTML5video)[0].currentTime=0;} $html.removeClass('popupShown');clearTimeout(window.clearPopupElementAnimation);$(element).find('.done').removeClass('done');$(element).removeClass('visible animate active');window.allowSlide=1;window.popupShown=0;}} $(document).on('click',function(e){var container=$(".popupShown .popup .popupContent, .popupTrigger");if(!container.is(e.target)&&container.has(e.target).length===0&&container.length>0){hidePopup();}});$('.popup .close').on('click',function(){hidePopup();});$(window).on('resize load ready',function(){equalizeELements();});function equalizeELements(){var gridEl=$('.grid.equal');if(gridEl.length){$(gridEl).each(function(index,element){var screenWidth=$(window).width(),collapseWidth=($(element).hasClass('later'))?767:1024,equalElement=$(element).find('.equalElement'),equalMobile=$(this).hasClass('equalMobile');if((screenWidth>=collapseWidth)||(equalMobile)){var height=0;$(equalElement).each(function(index,el){$(el).css('height','auto');if(height<$(el).outerHeight()){height=$(el).outerHeight();}});$(element).find('.equalElement').each(function(index,el){$(el).css('height',height+"px");});}else{$(equalElement).css("height",'auto');}});}} $(window).on('resize',function(){$html.addClass('resizing');}).on('resizeEnd',function(){$html.removeClass('resizing');});var sliderEl=$('.slider');if($(sliderEl).length>0){$(sliderEl).each(function(index,element){if($(element).hasClass('clickable')){$(element).on('click',function(){var el=$(this),selected=$(el).find('.selected'),$selected=$(selected),nextElement=$(selected).nextOrFirst('li'),nextIndex=$(nextElement).index(),sliderID=$(el).data('slider-id'),controller=$('.controller[data-slider-id="'+sliderID+'"]');$(selected).removeClass('selected').addClass('hide');$(nextElement).removeClass('hide').addClass('selected');$selected.one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend',function(){$(this).removeClass('hide');});if((sliderID)&&($(controller).length>0)){$(controller).find('.selected').removeClass('selected');$(controller).children('li:eq('+nextIndex+')').addClass('selected');}});}});} var controller=$('.controller');if($(controller).length>0){$(controller).find('li').each(function(index,element){$(element).on('click',function(){var controllerElement=$(this),selectedElement=$(controllerElement).closest('.controller').find('.selected'),elementIndex=$(this).index(),controllerId=$(controllerElement).closest('.controller').data('slider-id'),sliderId=$('.slider[data-slider-id="'+controllerId+'"]');if(!$(controllerElement).hasClass('selected')){$(selectedElement).removeClass('selected');$(controllerElement).addClass('selected');sliderId.find('.selected').removeClass('selected').addClass('hide').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend',function(){$(this).removeClass('hide');});sliderId.children('li:eq('+elementIndex+')').removeClass('hide').addClass('selected');}});});} $('[data-slider-action]').click(function(){if($(this).data('slider-id')){var desiredElement,desiredIndex,sliderID=$(this).data('slider-id'),action=$(this).data('slider-action'),slider=$('.slider[data-slider-id="'+sliderID+'"]'),controller=$('.controller[data-slider-id="'+sliderID+'"]'),selected=$(slider).find('.selected');if(action==="next"){desiredElement=$(selected).nextOrFirst('li');}else if(action==="prev"){desiredElement=$(selected).prevOrLast('li');} desiredIndex=$(desiredElement).index();$(selected).removeClass('selected');$(desiredElement).removeClass('hide').addClass('selected');if((sliderID)&&($(controller).length>0)){$(controller).find('.selected').removeClass('selected').addClass('hide').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend',function(){$(this).removeClass('hide');});$(controller).children('li:eq('+desiredIndex+')').addClass('selected');}}});$('[data-slider-id].autoHeight').each(function(index,element){$(window).on('click resize load ready',function(){var totalHeight=0;$(element).find('.selected').children().each(function(){totalHeight+=Math.round($(this).outerHeight());});$(element).height(totalHeight+"px");});});window.dropdownShown=false;$('.dropdownTrigger').click(function(){if(window.dropdownShown){hideShare();}else{var offset=$(this).offset(),offsetY=Math.ceil(offset.top),offsetX=Math.ceil(offset.left),shareID=$(this).data('dropdown-id'),element=$('.dropdown[data-dropdown-id="'+shareID+'"]');clearTimeout(window.hideDropdown);if($(element).hasClass('bottom')){offsetY=offsetY-$(element).outerHeight();}else{offsetY=offsetY+$(this).outerHeight();} if($(element).hasClass('right')){offsetX=offsetX-$(element).outerWidth()+$(this).outerWidth();} $(element).removeClass('show hide').addClass('show').css('top',offsetY).css('left',offsetX);$html.addClass('dropdownShown');window.dropdownShown=true;}});function hideShare(){if(window.dropdownShown){$('.dropdown').addClass('hide');$html.removeClass('dropdownShown');window.hideDropdown=setTimeout(function(){$('.dropdown').removeClass('show hide');},500);window.dropdownShown=false;} hideShareonScrollDelay=0;} $(window).on('resize',function(){hideShare();});$(document).on('mouseup touchstart',function(e){var container=$(".dropdownShown .dropdown, .dropdownTrigger");if(!container.is(e.target)&&container.has(e.target).length===0){hideShare();}});window.shareUrl=window.location.href;if($('.share').data('url')){window.shareUrl=$('.dropdown').data('url');} window.shareText=document.title;if($('.share').data('text')){window.shareText=$('.dropdown').data('url');} $('.share').sharrre({enableHover:false,shorterTotal:true,url:window.shareUrl,text:window.shareText,enableCounter:false,share:{twitter:true,facebook:true,pinterest:true,googlePlus:true,stumbleupon:true,linkedin:true},buttons:{pinterest:{media:$('.dropdown').data('pinterest-image'),description:$('.dropdown').data('text')+" "+$('.dropdown').data('url')}},template:$('.share').html(),render:function(api){$(api.element).on('click touchstart','.twitter',function(){api.openPopup('twitter');});$(api.element).on('click touchstart','.facebook',function(){api.openPopup('facebook');});$(api.element).on('click touchstart','.pinterest',function(){api.openPopup('pinterest');});$(api.element).on('click touchstart','.googlePlus',function(){api.openPopup('googlePlus');});$(api.element).on('click touchstart','.stumbleupon',function(){api.openPopup('stumbleupon');});$(api.element).on('click touchstart','.linkedin',function(){api.openPopup('linkedin');});$(api.element).on('click touchstart','.mail',function(){var subject=($(this).data('subject')?$(this).data('subject'):"");var body=($(this).data('body')?$(this).data('body'):"");var url=window.location.href;if($('.dropdown').data('url')){url=$('.dropdown').data('url');} window.location.href="mailto:?Subject="+encodeURIComponent(subject)+"&Body="+encodeURIComponent(body)+" "+url;});}});$("#contact-form").ajaxForm(function(){var $contactFormButton=$("#contact-form .button"),successText=$contactFormButton.data('success-text')?$contactFormButton.data('success-text'):"Done!",successClass=$contactFormButton.data('success-class')?$contactFormButton.data('success-class'):"green",defaultText=$contactFormButton.val();$contactFormButton.attr('value',successText).addClass(successClass);setTimeout(function(){$("#contact-form .button").attr('value',defaultText).removeClass(successClass);$("#contact-form")[0].reset();},4000);});});