/** * ThemeMountain Timber Framework * Version: 1.1.4 * URL: @ThemeMountain */ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-54904032-4', 'auto'); ga('send', 'pageview'); $( function(){ "use strict"; // Version var versionNumber = 'v.1.1.5'; $( '.version-number' ).each( function(){ var text = $( this ).text(); $( this ).text( text + ' ' + versionNumber ); }); // download link $( '.download-link' ).attr( 'href', 'http://download.thememountain.com/framework/framework_download_'+ versionNumber + '.zip'); // Code blocks $( '.code-snippet' ).each( function( i ){ // Some variables var pre = $( this ).find( 'pre' ); var code = $( this ).find( 'code' ); var content = code.html(); var ctcButton; var copyCode; // Create and append ctc button ctcButton = $( '' ); code.attr( 'id', 'snippet-' + i ); ctcButton.appendTo( pre ); // Add clipboard event copyCode = new Clipboard( '.copy-to-clipboard' ); copyCode.on( 'success', function(event) { event.clearSelection(); event.trigger.textContent = 'Copied'; window.setTimeout(function() { event.trigger.textContent = 'Copy'; }, 2000 ); }); copyCode.on('error', function(event) { event.trigger.textContent = 'Press "Ctrl + C" to copy'; window.setTimeout(function() { event.trigger.textContent = 'Copy'; }, 2000 ); }); // Format code // Check script or link tags are already escaped if ( code.text().indexOf( 'script' ) >= 0 || code.text().indexOf( 'link' ) >= 0 ) code.addClass( 'escaped' ); // Escape and handle indentation var tabs = content.match( /\s*\n[\t\s]*/ ); code.html( content.replace( new RegExp( tabs, 'g' ), '\n' ) ); code.html( escapeHtml( code.html() ) ); function escapeHtml( text ) { var chars = { '&': '&', '<': '<', '>': '>', '`': '>', '"': '"', "'": ''' }; return text.replace( /[&<>`"']/g, function( m ) { return chars[m]; }); } // Format escaped sections if ( code.hasClass( 'escaped' ) ){ var scriptTag = $( '
' ).html( code.text() ).text(); code.text( scriptTag ); } }); }); /** * Swipe Plugin * Version: 1.0 */ !function(t){"use strict";t.fn.swipeIt=function(i){var e=t.extend({swipeThreshold:40,scrollThreshold:10,draggable:!1,preventTouchOn:"",onSwipeMove:null,onSwipeEnd:null},i),a=this,n=0,s=0,o=e.swipeThreshold,r="ontouchend"in document,d=r?"touchstart":"pointerdown",c=r?"touchmove":"pointermove",l=r?"touchend":"pointermove",u=function(t){t.stopPropagation(),n=t.originalEvent.touches?t.originalEvent.touches[0].pageX:t,a.on(c,h)},h=function(i){if(!t(i.target).closest(e.preventTouchOn).length||""===e.preventTouchOn){if(s=i.originalEvent.touches?i.originalEvent.touches[0].pageX:i,Math.abs(n-s)>e.scrollThreshold&&i.preventDefault(),e.draggable){var o;o=-(n-s),e.onSwipeMove(o)}if(s===n)return!1;a.on(l,p)}},p=function(){var t;Math.abs(s-n)>o&&(t=s>n?"left":"right",e.onSwipeEnd(t)),a.off(c,h),a.off(l,p)};return a.on(d,u),this}}(jQuery); /** * Timber * Version: 1.1.4 */ $(document).ready(function(){"use strict";var a,b=ea?"touchstart":"click",c=".wrapper",d=".element-reveal-left",e=".element-reveal-right",f=".side-navigation-wrapper",g=".side-nav-show, a.side-nav-show",h=".side-nav-hide a",i=".no-scroll",j=".element-show-left",k=".element-show-right",l="easeInOutQuint",m={init:function(){if(!$(f).length)return!1;$("body").data("aux-nav",!1);var a=$(f).data("animation")?$(f).data("animation"):"no-transition",n=$(f).is("[data-no-scrollbar]")?"no-scrollbar":"scrollbar";"no-transition"===a&&$(c).addClass(a+"-reset"),$(c).addClass("reveal-side-navigation"),$(f).addClass(a+"-reset "+n);var o=$(f).hasClass("enter-right")?"right":"left";_?p="left"===o?d:e:(p="left"===o?j:k,$(f).addClass("hide"));var p=p.split(".").join("");i=i.split(".").join(""),$(g).on(b,function(d){if(d.preventDefault(),$(f).hasClass("active"))m.closeNav(p,a);else{A.state(!0),y.state(!0),$("body").data("aux-nav",!0),$("html, body").addClass(i);var e=$(window).scrollTop();ea||$(".header-inner").css({top:e+"px"}),_?($(c).addClass(p+" inactive "+a).css({transitionTimingFunction:da[l]}),$(f).addClass("active "+a).css({transitionTimingFunction:da[l]})):($(c).addClass(p),$(f).removeClass("hide").addClass("active")),$(c).on(ca,function(c){return c.target===$(this)[0]&&(c.stopPropagation(),$(this).off(ca),void $(".reveal-side-navigation").on(b,function(c){$(".reveal-side-navigation").off(b),m.closeNav(p,a)}))})}}),$(h).on(b,function(c){c.preventDefault(),$(".reveal-side-navigation").off(b),m.closeNav(p,a)}),$(window).on("resize",function(){$("body").data("aux-nav")?y.state(!0):y.state(!1)})},closeNav:function(a,b){_?(A.state(!0),$(c).removeClass(a+" "+b),$(f).removeClass(b),"no-transition"===b&&($("html, body").removeClass(i),$(c).removeClass("inactive"),$(f).removeClass("active")),$(c).on(ca,function(a){return a.target===$(this)[0]&&(a.stopPropagation(),y.state(!1),$(this).off(ca),$("html, body").removeClass(i),$(c).removeClass("inactive"),$(f).removeClass("active"),void(ea||$(".header-inner").css({top:0})))})):($(c).removeClass(a+" "+b),$(f).addClass("hide").removeClass("active")),$("body").data("aux-nav",!1)}},n=".overlay-navigation-wrapper",o=".overlay-navigation-inner",p=".overlay-nav-show a, a.overlay-nav-show",q=".overlay-nav-hide a, .one-page-nav .overlay-navigation .scroll-link",r=".no-scroll",s="easeInOutQuint",t={init:function(){if(!$(n).length)return!1;var a=$(n).data("animation")?$(n).data("animation"):"no-transition",c=$(n).is("[data-no-scrollbar]")?"no-scrollbar":"scrollbar";$(n).addClass(a+"-reset "+c),r=r.split(".").join(""),$(p).on(b,function(b){b.preventDefault(),$(n).hasClass("active")?t.closeNav(a):($("body").data("aux-nav",!0),$("html, body").addClass(r),_?$(n).addClass("active "+a).css({transitionTimingFunction:da[s]}):$(n).addClass("active"),$(n).on(ca,function(a){return a.target===$(this)[0]&&(a.stopPropagation(),y.state(!0),void $(this).off(ca))}))}),$(o).on(b,function(b){b.target===this&&t.closeNav(a)}),$(q).on(b,function(b){b.preventDefault(),t.closeNav(a)}),$(window).on("resize",function(){$("body").data("aux-nav")?y.state(!0):y.state(!1)})},closeNav:function(a){_?($(n).removeClass(a),"no-transition"===a&&($("html, body").removeClass(r),$(n).removeClass("active")),$(n).on(ca,function(a){return a.target===$(this)[0]&&(a.stopPropagation(),y.state(!1),$(this).off(ca),$("html, body").removeClass(r),void $(n).removeClass("active"))})):$(n).removeClass("active").css({top:"-100%"}),$("body").data("aux-nav",!1)}},u=".side-navigation-wrapper, .overlay-navigation-wrapper",v=".sub-menu",w=".contains-sub-menu",x={init:function(){$(u).find(w).each(function(){var a,c;$(this).parent().hasClass("current")&&(a=$(this).siblings(v).children(),c=0,a.each(function(){c+=$(this).outerHeight()}),$(this).siblings(v).addClass("open").css({height:c+"px"})),$(this).on(b,function(b){b.preventDefault(),$(this).parent().hasClass("current")?$(u).find("nav").children("ul").children().removeClass("current"):($(u).find("nav").children("ul").children().removeClass("current"),$(this).parent().addClass("current")),A.state(!0),a=$(this).siblings(v).children(),c=0,a.each(function(){c+=$(this).outerHeight()}),$(this).siblings(v).hasClass("open")?$(this).closest(u).find(v).css({height:0}).removeClass("open"):($(this).closest(u).find(v).css({height:0}).removeClass("open"),$(this).siblings(v).css({height:c+"px"}),$(this).siblings(v).addClass("open"))})})}},y={state:function(a){ea?a?$("body").addClass("aux-navigation-active"):$("body").removeClass("aux-navigation-active"):a?$("body").addClass("aux-navigation-active"):$("body").data("aux-nav")||$("body").removeClass("aux-navigation-active")}},z=".header, .header-inner, .logo, .logo a, .header .navigation",A={init:function(){ea||$(window).on("scroll",function(){A.state(!0)}),$(window).on("resize",function(){A.state(!1)})},state:function(a){a?$(z).removeClass("no-transition"):$(z).addClass("no-transition")}},B=300,C=".scroll-to-top",D=600,E={init:function(){$(window).on("scroll",function(){return!$(C).is("[data-no-hide]")&&void($(this).scrollTop()>B?$(C).fadeIn(D):$(C).fadeOut(D))}),$(C).on(b,function(a){a.preventDefault(),E.scrollUp()})},scrollUp:function(){$("html, body").animate({scrollTop:0},D)}},F=".header",G=".tabs",H=".tab-trigger-click",I=".accordion",J="icon-plus",K="icon-minus",L=".accordion-content",M=".accordion-trigger-click",N=".box.dismissable",O=300,P="swing",Q=".dropdown",R=".thumbnail",S=".overlay-info, img",T=".overlay-info",U=400,V="easeInOutQuint",W=".background-image-container",X={init:function(){X.tabs(),X.accordions(),X.dismissable(),X.dropdown(),X.rollovers(),X.thumbnailRatio(),X.setAsBackground()},tabs:function(){$(G).each(function(){var a=$(this).children(".tab-nav").find("li > a");$(this).find(".tab-panes > .active").addClass("animate-in"),a.each(function(){$(this).on(b,function(){var a=$(this).attr("href"),b=$(this).closest(".tabs").find(a);if($(this).closest(".tab-nav").find(".active").removeClass("active"),$(this).parent().addClass("active"),$(this).closest(".tabs").find(".tab-panes > .active").removeClass("active animate-in"),b.addClass("active"),b.find(".tm-slider-container").length>0){var c=b.find(".tm-slider-container").data("avalancheSlider");c.resizeSlider()}var d=null;return clearTimeout(d),d=setTimeout(function(){b.addClass("animate-in")},50),!1}),$(this).parent().hasClass("active")&&$(this).closest(".tabs").find($(this).attr("href")).addClass("active")})}),$(H).each(function(){$(this).on("click",function(){var a=$(this).data("target-tab");return $(G).find(a).trigger("click"),!1})})},accordions:function(){$(I).each(function(){var a=$(this).children().children().children("a");a.each(function(){$(this).closest(I).is("[data-toggle-icon]")&&($(this).find("span").length||$(this).parent().hasClass("active")?!$(this).find("span").length&&$(this).parent().hasClass("active")&&$(this).prepend(''):$(this).prepend('')),$(this).on(b,function(){var a=$(this),b=a.attr("href"),c=a.closest(I).find(b),d=a.closest(I).find(L).parent();a.closest(I).children().children(".active").children("div").each(function(){var a=$(this).children().outerHeight();$(this).addClass("no-transition").css({height:a+"px"})});var e=null;return clearTimeout(e),e=a.parent().hasClass("active")?setTimeout(function(){a.closest(I).is("[data-toggle-multiple]")?a.siblings(c).removeClass("no-transition").css({height:0}):a.siblings("div").removeClass("no-transition").css({height:0}),a.parent().removeClass("active")},50):setTimeout(function(){var b=a.siblings(c).find(L).outerHeight();a.closest(I).is("[data-toggle-multiple]")||(d.removeClass("no-transition").css({height:0}),a.closest(I).children().children("li").removeClass("active")),a.parent().addClass("active"),a.siblings(c).removeClass("no-transition").css({height:b+"px"})},50),a.find("."+K).length?a.find("."+K).removeClass(K).addClass(J):a.find("."+J).length&&(a.closest(I).is("[data-toggle-multiple]")||a.closest("ul").find("."+K).removeClass(K).addClass(J),a.find("."+J).removeClass(J).addClass(K)),!1})}),$(M).each(function(){$(this).on("click",function(){var a=$(this).data("target-accordion");return $(I).find(a).trigger("click"),!1})}),$(window).on("resize",function(){$(I).each(function(){$(this).children().children(".active").children("div").addClass("no-transition").css({height:"auto"})})})})},dismissable:function(){$(N).each(function(){$(this).find(".close").length||$(this).prepend(''),$(this).find(".close").on(b,function(a){a.preventDefault(),_?$(this).parent().css({transitionProperty:"opacity",opacity:0,transitionDuration:O+"ms",transitionTimingFunction:da[P]}).on(ca,function(a){return a.stopPropagation(),a.target===$(this)[0]&&void $(this).remove()}):$(this).parent().animate({opacity:0},U,P,function(){$(this).remove()})})})},dropdown:function(){$(Q).each(function(){$(this).children(".button, button").not().each(function(){$(this).on(b,function(b){b.preventDefault(),$(Q).children(".button, button").removeClass("active");var c=$(this).parent().children(".dropdown-list");return!$(this).parent().hasClass("disabled")&&($(".dropdown-list").not($(c)).removeClass("active"),$(c).hasClass("active")?($(c).removeClass("active"),$(this).removeClass("active")):($(c).addClass("active"),$(this).addClass("active")),void $(document).on("click.closeDropdown",function(b){$(b.target).closest(Q).length||a()}))}),$(this).parent().children(".dropdown-list").find("li a").on(b,function(a){a.preventDefault(),$(".dropdown-list").removeClass("active"),$(this).removeClass("active")}),ea||$(window).on("scroll",function(){a()}),$(F).find(".navigation > ul > li > a").mouseenter(function(){a()});var a=function(){$(Q).each(function(){$(this).find(".button, button").removeClass("active"),$(this).find(".dropdown-list").removeClass("active")}),$(document).off("click.closeDropdown")}})})},rollovers:function(){_?$(R).each(function(){var a,b=$(this).data("hover-speed")?$(this).data("hover-speed"):U,c=$(this).data("hover-easing")?$(this).data("hover-easing"):V,d=$(this).data("hover-bkg-opacity")?$(this).data("hover-bkg-opacity"):1;if($(this).data("hover-bkg-color")){var e=$(this).data("hover-bkg-color");e=e.replace("#","");var f=parseInt(e.substring(0,2),16),g=parseInt(e.substring(2,4),16),h=parseInt(e.substring(4,6),16);a="rgba( "+f+","+g+","+h+","+d/1+" )"}else a=$(this).find(T).css("background-color");$(this).find(S).css({transitionDuration:b+"ms",transitionTimingFunction:da[c]}),$(this).find(T).css({backgroundColor:a})}):$(R).find(".overlay-link").mouseenter(function(){$(this).find(T).css({opacity:0}).stop().animate({opacity:1},U,V)}).mouseleave(function(){$(this).find(T).stop().animate({opacity:0},U,V)})},thumbnailRatio:function(){$(window).on("resize",function(){$(R).each(function(){if($(this).find(".caption-over-outer").length){var a=$(this).find("img, video"),b=a.attr("width"),c=a.attr("height"),d=$(this).find("img, video").width(),e=b>=c?b/c:c/b,f=b>=c?d/e:d*e;$(this).find(".caption-over-outer").css({opacity:1}),$(this).css({height:f+"px"})}})}).resize()},setAsBackground:function(){$(W).each(function(){var a=$(this).children("img").attr("src");$(this).css({"background-image":"url("+a+")"})})}},Y=document.body||document.documentElement,Z=Y.style,_=void 0!==Z.transition||void 0!==Z.WebkitTransition||void 0!==Z.MozTransition||void 0!==Z.MsTransition||void 0!==Z.OTransition,aa=["WebkitTransform","MozTransform","OTransform","msTransform"];for(var ba in aa)void 0!==Z[aa[ba]]&&(a="-"+aa[ba].replace("Transform","").toLowerCase());var ca="webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend";_&&(document.getElementsByTagName("body")[0].className+=" transition-support");var da={linear:"cubic-bezier(0, 0, 1, 1)",swing:"cubic-bezier(0.42, 0, 0.58, 1)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"};window.onpageshow=function(a){a.persisted&&$("body").addClass("page-fade-reset").removeClass("page-fade-out")};var ea=!1;(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i))&&(ea=!0,document.getElementsByTagName("body")[0].className+=" mobile");var fa="WebkitAppearance"in document.documentElement.style;fa&&(document.getElementsByTagName("body")[0].className+=" webkit");var ga=/constructor/i.test(window.HTMLElement);ga&&(document.getElementsByTagName("body")[0].className+=" safari-browser");var ha=document.all&&document.addEventListener||"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style;ha&&(document.getElementsByTagName("body")[0].className+=" ie-browser");var ia=document.all&&document.addEventListener;ia&&(document.getElementsByTagName("body")[0].className+=" ie-be-11",$(".flex").removeClass("flex").addClass("equalize")),m.init(),t.init(),x.init(),A.init(),E.init(),X.init()}); /** * Avalanche Slider * Version: 1.2.0 */ !function(a,b,c,d){"use strict";function e(b){b.find(".tms-caption").each(function(){function b(){a.each(d,function(a,b){b=b.split(":");var d=b[0],e=b[1];"opacity"===d&&c.data("o",e),"scale"===d&&c.data("s",e),"easing"===d&&c.data("e",e),"transX"===d&&c.data("tx",parseFloat(e)),"transY"===d&&c.data("ty",parseFloat(e)),"transZ"===d&&c.data("tz",parseFloat(e)),"rotateX"===d&&c.data("rx",parseFloat(e)),"rotateY"===d&&c.data("ry",parseFloat(e)),"rotateZ"===d&&c.data("rz",parseFloat(e)),"transOrigX"===d&&c.data("ox",e),"transOrigY"===d&&c.data("oy",e),"duration"===d&&c.data("du",parseFloat(e)),"delay"===d&&c.data("de",parseFloat(e))})}var c=a(this),d=String(c.data("animate-in")).split(";");c.is("[data-no-scale]")?c.addClass("no-scale"):c.addClass("scale"),c.parent().addClass("tms-perspective"),a.inArray("preset",String(d).split(":"))!=-1?d.filter(function(c){if("preset"===c.split(":")[0]){d.splice(a.inArray(c,d),1);var e=String(K[c.split(":")[1]]).split(";");d=a.merge(e,d).filter(Boolean),b()}}):b(),c.data("w",parseFloat(c.css("width"))),c.data("h",parseFloat(c.css("height"))),c.data("fs",parseFloat(c.css("font-size"))),c.data("lh",parseFloat(c.css("line-height"))),c.data("pt",parseFloat(c.css("padding-top"))),c.data("pr",parseFloat(c.css("padding-right"))),c.data("pb",parseFloat(c.css("padding-bottom"))),c.data("pl",parseFloat(c.css("padding-left"))),c.data("mt",parseFloat(c.css("margin-top"))),c.data("mr",parseFloat(c.css("margin-right"))),c.data("mb",parseFloat(c.css("margin-bottom"))),c.data("ml",parseFloat(c.css("margin-left"))),c.data("bt",parseFloat(c.css("border-top-width"))),c.data("br",parseFloat(c.css("border-right-width"))),c.data("bb",parseFloat(c.css("border-bottom-width"))),c.data("bl",parseFloat(c.css("border-left-width")))})}function f(b,d,e){var f=b.find(".tms-slide"),h=0;f.each(function(){var f=a(this),i=f.find("img").length,j=f.find("iframe, video").length;f.children(".tms-caption").length;u(f,d);var k=a('
');if(i>0&&(d.lazyLoad?k.appendTo(f):a(b).find(".tm-loader").length||k.appendTo(b)),j){L&&f.is("[data-video-bkg]")&&f.children("video").css({display:"none"});var l=f.find("iframe, video");z(b,l,d),s(f,d),r(b,d)}i?f.find("img").each(function(b,j){if(!a(this).attr("srcset")){j=a(this).data("src");var k=j,l=j.substr(j.lastIndexOf("."));(c.isRetinaDevice()&&d.retinaSupport||c.isRetinaDevice()&&a(this).is("[data-retina]"))&&(!L&&!d.retinaSupportMobile||L&&d.retinaSupportMobile)&&(j.match(/\.(svg)/i)||(j=a(this).data("retina")?a(this).data("retina"):a(this).data("src").replace(l,d.retinaSuffix+l)))}if(f.data("overlay-bkg-color")&&!f.find(".tms-overlay").length)var m=f.data("overlay-bkg-color").replace("#",""),n=f.data("overlay-bkg-opacity")?f.data("overlay-bkg-opacity"):.5,o=parseInt(m.substring(0,2),16),p=parseInt(m.substring(2,4),16),q=parseInt(m.substring(4,6),16),r="rgba( "+o+","+p+","+q+","+n/1+" )",s=a('
').css({backgroundColor:r,opacity:0}).appendTo(f);a(this).css({opacity:0}).attr("src",j).one("error",function(){a(this).attr("src",k),console.log("Error src:"+j)}).one("load",function(){f.css({transition:"none",opacity:0}),f.find(s).css({opacity:1}),a(this).data("loaded",!0).css({opacity:1}),b++,b===i&&(h++,g(f,h,d,e))})}):(h++,r(b,d),g(f,h,d,e))})}function g(b,c,d,e){var f=b.closest(".tm-slider-container"),g=f.find(".tms-slides"),i=f.find("li.active"),j=null,k=null,l=!(!b.is("[data-video-bkg-youtube]")&&!b.is("[data-video-bkg-vimeo]"));if(b.find(".no-transition").css({visibility:"visible"}),f.data("setup",!0),f.data("first-load",!1),f.data("animate-first-slide",!0),b.is("[data-as-bkg-image]")||b.is("[data-video-bkg]")||l){var n=b.children("img").attr("src"),p=b.data("image-wrapper")?b.data("image-wrapper"):b;b.data("image-wrapper")?b.find("."+p).css({"background-image":"url("+n+")"}):b.css({"background-image":"url("+n+")"}),b.children("img").hide()}if(0===f.height()&&!f.data("height")&&b.hasClass("active")){i.children("img").css({maxHeight:"none"});var q=i.children("img").height();f.data("refH",q),f.css({height:q+"px"}),i.children("img").css({maxHeight:"100%"})}if(s(b,d),r(f,d),d.carousel&&!d.lazyLoad&&(g.children().css({opacity:1}),g.css({opacity:0})),l||b.find("iframe, video").css({opacity:1}),c===g.children().length&&d.onLoadEnd&&d.onLoadEnd(),d.lazyLoad||c!==g.children().length?d.lazyLoad&&1===c&&(f.data("loaded",!0),d.autoAdvance&&e.initSlideshow()):(f.data("loaded",!0),d.autoAdvance&&e.initSlideshow()),d.lazyLoad){if((b.find(".tm-loader").length&&!l||L)&&h(f,b,d),(b.is(i)||d.carouselVisible>1)&&b.find(".tms-caption").show(),!b.hasClass("active"))return!1;E?(clearTimeout(k),k=setTimeout(function(){m(i,1,0,0,0,0,0,0,1,"50%","50%",1e3,0,"easeIn",d)},50)):b.animate({opacity:1}),l&&!L||(clearTimeout(j),j=setTimeout(function(){i.find(".tms-caption").length>0&&o(i,d),i.find(".tms-content-scalable").length>0&&a(".tms-content-scalable").css({opacity:1})},300))}else c===g.children().length&&((f.find(".tm-loader").length&&!l||L)&&h(f,b,d),i.find(".tms-caption").show(),d.carouselVisible>1&&f.find(".tms-caption").show(),E?d.carousel?m(g,1,0,0,0,0,0,0,1,"50%","50%",1e3,0,"easeIn",d):m(i,1,0,0,0,0,0,0,1,"50%","50%",1e3,0,"easeIn",d):d.carousel?g.animate({opacity:1}):i.animate({opacity:1}),l&&!L||(clearTimeout(j),j=setTimeout(function(){i.find(".tms-caption").length>0&&o(i,d),i.find(".tms-content-scalable").length>0&&a(".tms-content-scalable").css({opacity:1})},300)),f.find(".tms-arrow-nav, .tms-pagination").css({display:"block"}))}function h(a,b,c){var d=".tm-loader";c.lazyLoad?b.find(d).remove():a.find(d).remove()}var i=function(d,g){var h,i=a.extend({},a.fn.avalancheSlider.tmsOpts,g),l=a(d),o=this,t=i.fulscreen?a(c).width():i.fullwidth?i.scaleUnder:l.data("width")?parseFloat(l.data("width")):parseFloat(l.css("width")),v=i.fulscreen?a(c).height():l.data("height")?parseFloat(l.data("height")):parseFloat(l.css("height")),w=l.find(".tms-slides"),x=w.children("li:first-child").addClass("active"),y=[];if(w.children(".tms-slide").each(function(b){b++,a(this).attr("id","tms-slide-"+b),y.push(a(this).attr("id")),i.carousel||(E?a(this).not(".active").css({transition:"none",transform:"translate3d( 100%, 0, 0)"}):a(this).not(".active").css({left:"100%"}));var c=!!(a(this).is("[data-video-bkg]")||a(this).is("[data-video-bkg-youtube]")||a(this).is("[data-video-bkg-vimeo]"));(i.forceFit||a(this).is("[data-force-fit]")||c)&&a(this).addClass("tms-forcefit"),c&&a(this).addClass("tms-bkg-video"),a(this).is("[data-video-bkg-youtube]")&&a(this).addClass("tms-bkg-video-youtube"),a(this).is("[data-video-bkg-vimeo]")&&a(this).addClass("tms-bkg-video-vimeo")}),i.lazyLoad||x.css({opacity:0}),i.scaleUnder=l.data("scale-under")?l.data("scale-under"):i.scaleUnder,i.scaleMinHeight=l.data("scale-min-height")?l.data("scale-min-height"):i.scaleMinHeight,i.animation=l.data("animation")?l.data("animation"):i.animation,h=i.animation,i.easing=l.data("easing")?l.data("easing"):i.easing,i.speed=l.data("speed")?l.data("speed"):i.speed,i.carousel=l.data("carousel")?l.data("carousel"):i.carousel,i.carouselVisible=l.data("carousel-visible-slides")?l.data("carousel-visible-slides"):i.carouselVisible,i.carouselVisible=i.carouselVisible>w.children().length?w.children().length:i.carouselVisible,i.showProgressBar=!l.is('[data-progress-bar="false"]')&&i.showProgressBar,i.autoAdvance=!!l.is("[data-auto-advance]")||i.autoAdvance,i.interval=l.data("auto-advance-interval")?l.data("auto-advance-interval"):i.interval,i.pauseOnHover=!l.is('[data-pause-on-hover="false"]')&&i.pauseOnHover,i.navArrows=!l.is('[data-nav-arrows="false"]')&&i.navArrows,i.navPagination=!l.is('[data-nav-pagination="false"]')&&i.navPagination,i.navShowOnHover=!l.is('[data-nav-show-on-hover="false"]')&&i.navShowOnHover,i.navKeyboard=!l.is('[data-nav-keyboard="false"]')&&i.navKeyboard,(l.is("[data-nav-dark]")||x.is("[data-nav-dark]"))&&(l.addClass("tms-nav-dark"),l.is("[data-featured-slider]")&&a("header").addClass("nav-dark")),i.fullscreen&&(l.css({top:0,left:0}).addClass("tms-fullscreen"),i.carouselVisible=1,i.fsUseHeightOf=i.fsUseHeightOf||l.data("fs-use-height")?i.fsUseHeightOf&&!l.data("fs-use-height")?i.fsUseHeightOf:l.data("fs-use-height"):"",i.fsUseHeightOf=i.fsUseHeightOf?"parent"===i.fsUseHeightOf?l.parent():l.closest("."+i.fsUseHeightOf):""),i.parallax=!!l.is("[data-parallax]")||i.parallax,i.parallaxSpeed=l.data("parallax-speed")?l.data("parallax-speed"):i.parallaxSpeed,i.parallaxScale=!(!l.is("[data-parallax-scale-out]")&&!l.is("[data-parallax-scale-in]"))||i.parallaxScale,i.parallaxFadeOut=!!l.is("[data-parallax-fade-out]")||i.parallaxFadeOut,i.captionScaling||l.addClass("tms-caption-no-scaling"),!i.carousel&&i.carouselVisible&&(i.carouselVisible=1),i.carouselVisible>1&&(i.animation="slide"),i.carousel&&l.addClass("tms-carousel"),i.carouselScaleHeight&&l.addClass("tms-scalable-height"),i.autoPlay=!l.is('[data-video-auto-play="false"]')&&i.autoPlay,i.replayOnEnd=!l.is('[data-replay-on-end="false"]')&&i.replayOnEnd,i.muteBkgVideo=!!l.is("[data-mute-video]")||i.muteBkgVideo,L&&(i.autoPlay=!1,i.useVideoAPI=!1),i.navShowOnHover&&l.addClass("show-on-hover"),i.navArrows&&w.children().length>1){var z=a('').attr("id","tms-prev").addClass("tms-arrow-nav").appendTo(l),B=a('').attr("id","tms-next").addClass("tms-arrow-nav").appendTo(l);z.each(function(){a(this).on("click",function(a){a.preventDefault(),i.autoAdvance&&l.data("loaded")&&o.resetSlideshow(),o.prevSlide()})}),B.each(function(){a(this).on("click",function(a){a.preventDefault(),i.autoAdvance&&l.data("loaded")&&o.resetSlideshow(),o.nextSlide()})}),i.lazyLoad&&l.addClass("lazyload").find(".tms-arrow-nav").css({display:"block"})}if(i.navPagination&&w.children().length>1){for(var C=a("
").addClass("tms-pagination").appendTo(l),D=1;D');var F="bullets"===i.paginationType?l.find(".tms-bullet-nav"):l.find(".tms-thumb-nav");F.each(function(){a(this).on("click",function(){return x=l.find("li.active"),!a(this).hasClass("active")&&(i.autoAdvance&&l.data("loaded")&&o.resetSlideshow(),parseFloat(a(this).data("index"))>parseFloat(C.find(".active").data("index"))?o.slideTo(a(this).data("index"),"next"):o.slideTo(a(this).data("index"),"prev"),!1)})}),C.find(".tms-bullet-nav:first-child").addClass("active"),i.lazyLoad&&C.css({display:"block"})}if(i.navKeyboard&&w.children().length>1){var G=[];a(b).on("keydown",function(a){return G[a.keyCode]=!0,(!G[37]||!G[39])&&void(G[37]?(i.autoAdvance&&l.data("loaded")&&o.resetSlideshow(),i.lazyLoad?o.prevSlide():l.data("loaded")&&o.prevSlide()):G[39]&&(i.autoAdvance&&l.data("loaded")&&o.resetSlideshow(),i.lazyLoad?o.nextSlide():l.data("loaded")&&o.nextSlide()))}).on("keyup",function(a){G[a.keyCode]=!1})}l.swipeIt({draggable:!1,onSwipeMove:function(a){},onSwipeEnd:function(a){"left"===a?o.prevSlide():o.nextSlide()}}),a(c).on("resize",function(){l.data("first-load")&&(t=i.fulscreen?a(c).width():i.fullwidth?i.scaleUnder:l.data("width")?parseFloat(l.data("width")):parseFloat(l.css("width")),v=i.fulscreen?a(c).height():l.data("height")?parseFloat(l.data("height")):parseFloat(l.css("height")),l.data("refW",t).data("refH",v).data("carousel-height",v));var b=l.find("li.active, li.target");i.carousel&&i.carouselVisible>1?w.children(".tms-slide").each(function(){s(a(this),i)}):s(b,i),r(l,i),l.addClass("resizing"),A(function(){l.removeClass("resizing")},300,"resize")}),l.parent().hasClass("tm-slider-parallax-container")&&i.parallax?(a(c).on("scroll",function(){j(l,i)}),k(l,i)):!l.parent().hasClass("tm-slider-parallax-container")&&i.parallax&&console.log("Add the class tm-slider-parallax-container to slider parent"),l.data("setup",!1).data("loaded",!1).data("first-load",!0).data("scale-first",!0).data("transitioning",!1).data("refW",t).data("refH",v).data("carousel-height",v),e(l),r(l,i),i.onSetup&&i.onSetup(),o.resizeSlider=function(){var a=l.find("li.active, li.target");s(a,i),r(l,i)};var H,I,K,M,N,O,P,Q=null,R=null;o.initSlideshow=function(){return!(H||w.children().length<2)&&(i.autoAdvance=!0,!L&&i.pauseOnHover&&(w.on("mouseleave ",o.resumeSlideshow),w.on("mouseenter ",o.pauseSlideshow)),i.showProgressBar&&(P=a("
").addClass("tms-progress-bar").appendTo(l)),o.startSlideshow(),S(i.interval),I=(new Date).getTime(),N=i.interval,void(i.onSlideshowStart&&i.onSlideshowStart()))},o.startSlideshow=function(a){a=a?M:i.interval,H=setInterval(function(){a!==i.interval&&(clearInterval(H),a=i.interval,N=i.interval,o.startSlideshow()),I=(new Date).getTime(),"undefined"!=typeof P&&P.css({transition:"none",width:"0px"}),S(i.interval),o.nextSlide()},a)},o.pauseSlideshow=function(){return!(O||!H)&&(clearInterval(H),K=(new Date).getTime(),M=N-(K-I)<50?50:N-(K-I),N=0===N?i.interval:M,"undefined"!=typeof P&&P.stop().css({width:P.width()+"px"}),O=!0,void(i.onSlideshowPause&&i.onSlideshowPause()))},o.resumeSlideshow=function(){return!!O&&(clearInterval(H),l.data("ssPaused",!1),I=(new Date).getTime(),S(M),o.startSlideshow(M),void(O=!1))},o.resetSlideshow=function(){return!!H&&(clearInterval(H),"undefined"!=typeof P&&P.css({transition:"none",width:"0px"}),S(i.interval),I=(new Date).getTime(),M=i.interval,N=i.interval,void o.startSlideshow(i.interval))},o.endSlideshow=function(){return!!H&&(clearInterval(H),H="",O=!1,!L&&i.pauseOnHover&&(w.off("mouseleave ",o.resumeSlideshow),w.off("mouseenter ",o.pauseSlideshow)),"undefined"!=typeof P&&P.remove(),void(i.onSlideshowEnd&&i.onSlideshowEnd()))};var S=function(a){return"undefined"!=typeof P&&void(E?(clearTimeout(Q),Q=setTimeout(function(){P.css({transitionProperty:"width",width:"100%",transitionDuration:a+"ms",transitionTimingFunction:"ease"})},50)):P.stop(!0,!0).animate({width:"100%"},a))};o.nextSlide=function(){if(l.data("transitioning"))return!1;var b;x=l.find("li.active");var c=y[a.inArray(x.attr("id"),y)+1];if(b=a.inArray(c,y)+1===0?1:a.inArray(c,y)+1,i.carousel&&i.carouselVisible>1){var d=q(l,i);1!==d&&(b=b===w.children().length-(d-2)?1:a.inArray(c,y)+1)}this.slideTo(b,"next")},o.prevSlide=function(){if(l.data("transitioning"))return!1;var b;x=l.find("li.active");var c=y[a.inArray(x.attr("id"),y)-1];if(b=a.inArray(c,y)+1===0?w.children().length:a.inArray(c,y)+1,i.carousel&&i.carouselVisible>1){var d=q(l,i);b=b===w.children().length?w.children().length-(d-1):a.inArray(c,y)+1}this.slideTo(b,"prev")},o.slideTo=function(b,c){if(l.data("first-load",!1),l.data("scale-first",!1),c||(x=l.find("li.active")),l.data("transitioning")||b===a.inArray(x.attr("id"),y)+1)return!1;p(l,b);var d=l.width(),e=l.height(),f=l.find("#tms-slide-"+b);f.addClass("target").css({zIndex:2,opacity:0===g?0:1}),x.css({zIndex:1}),i.animation=f.data("animation")?f.data("animation"):h;var g="slide"===i.animation||"slideLeftRight"===i.animation?d:0,k="slideTopBottom"===i.animation?e:0;g*=i.carousel?b-1:1;var o="scaleIn"===i.animation?1-i.scaleFactor:"scaleOut"===i.animation?1+i.scaleFactor:1;l.is("[data-nav-dark]")||l.removeClass("tms-nav-dark"),f.is("[data-nav-dark]")?(l.addClass("tms-nav-dark"),l.is("[data-featured-slider]")&&a("header").addClass("nav-dark")):l.is("[data-featured-slider]")&&a("header").removeClass("nav-dark"),u(f,i),l.parent().hasClass("tm-slider-parallax-container")&&i.parallax&&j(l,i),!f.children("img").data("loaded")&&f.children("img").length||s(f,i),r(l,i,f),c||(c="next"),c=i.carousel?1:"next"===c?1:-1;var t=q(l,i);E?i.carousel?m(w,1,-(g/t)*c,0,0,0,0,0,1,"50%","50%",i.speed,0,J[i.easing],i):(f.css({opacity:0,transition:"none",transform:"translate3d("+g*c+"px,"+k*c+"px, 0) scale3d("+o+", "+o+", "+o+")"}),clearTimeout(R),R=setTimeout(function(){m(x,1,-g*c,-k*c,0,0,0,0,o,"50%","50%",i.speed,0,J[i.easing],i),m(f,1,0,0,0,0,0,0,1,"50%","50%",i.speed,0,J[i.easing],i)},50)):i.carousel?(l.data("transitioning",!0),w.animate({opacity:1,left:-(g/t)*c+"px"},i.speed,i.easingFallback,function(){n(l,i)})):(l.data("transitioning",!0),f.css({left:d*c+"px",visibility:"visible"}).animate({opacity:1,left:"0px"},i.speed,i.easingFallback,function(){n(l,i)}),x.animate({left:-d*c+"px"},i.speed,i.easingFallback))},f(l,i,o)},j=function(b,d){var e=a(c);e.data("animating")||(e.data("animating",!0),c.requestAnimationFrame(function(){k(b,d),e.data("animating",!1)}))},k=function(b,d){var e=a(c),f=e.scrollTop(),g=(e.height(),b.parent().height()+b.parent().offset().top-f),h=f*d.parallaxSpeed,i=d.parallaxScale&&b.is("[data-parallax-scale-out]")?1.1+g/b.parent().height():d.parallaxScale&&b.is("[data-parallax-scale-in]")?2-g/b.parent().height():1;i=i<1?1:i;var j=d.parallaxFadeOut?g/b.parent().height():1,k=b.find("li.active"),m=!!k.is("[data-pause-on-scroll]");if(!L&&E&&l(b.parent())){b.css({position:"fixed",transform:"translate3d( 0, "+-h+"px, 0)",opacity:j.toFixed(2)});var n=".active > img, .target > img, .active > iframe, .target > iframe, .active > video, .target > video";b.find(n).css({transform:"scale3d( "+i+","+i+", 1 )"}),m&&v(k,"play",d)}else b.css({position:"relative"}),m&&v(k,"pause",d)},l=function(b){var d=a(c).scrollTop(),e=d+a(c).height(),f=b.offset().top,g=f+b.outerHeight();return e>=f&&d<=g},m=function(b,c,d,e,f,g,h,i,j,k,l,m,o,p,q){var r=b.closest(".tm-slider-container");(b.hasClass("active")||b.hasClass("target")||b.hasClass("tms-slides"))&&(r.data("animate-first-slide")||r.data("transitioning",!0),q.onSlideBefore&&q.onSlideBefore());var s={};s.transform="translate3d("+d+"px, "+e+"px, "+f+"px) rotateX("+g+"deg) rotateY("+h+"deg) rotateZ("+i+"deg) scale3d("+j+", "+j+", "+j+")",s.transitionProperty=H+", opacity",s.transformOrigin=k+" "+l+" 0",s.transitionDuration=m+"ms",s.transitionDelay=o+"ms",s.transitionTimingFunction=p,s.visibility="visible",s.opacity=c,b.css(s).on(I,function(b){b.stopPropagation(),a(this).off(I),(a(this).hasClass("target")||a(this).hasClass("tms-slides")&&!r.data("animate-first-slide"))&&n(r,q),a(this).hasClass("tms-caption")&&a(this).css({transition:""}),r.data("animate-first-slide")&&r.data("animate-first-slide",!1)})},n=function(a,b){a.data("transitioning",!1),b.onSlideAfter&&b.onSlideAfter();var c=a.find("li.active"),d=a.find("li.target"),e=!(!d.is("[data-video-bkg-youtube]")&&!d.is("[data-video-bkg-vimeo]"));return v(c,"pause",b),1===b.carouselVisible&&c.find(".tms-caption").not(".no-transition").css({display:"none",visibility:"hidden"}),b.carousel||c.css({visibility:"hidden"}),c.removeClass("active"),d.removeClass("target").addClass("active"),c=d,v(c,"play",b),!(b.carouselVisible>1)&&void(e&&!L||o(c,b))},o=function(b,c){b.find(".tms-caption").not(".no-transition").show().each(function(){var b=a(this),d=a(this).data("ox")?b.data("ox"):"50%",e=a(this).data("oy")?b.data("oy"):"50%",f=a(this).data("du")?b.data("du"):c.speed,g=a(this).data("de")?b.data("de"):0,h=a(this).data("e")?J[b.data("e")]:J[c.easing],i=null;E?(clearTimeout(i),i=setTimeout(function(){m(b,1,0,0,0,0,0,0,1,d,e,f,g,h)},500)):(h=c.easingFallback,b.delay(g).css({visibility:"visible"}).animate({opacity:1},f,h))})},p=function(a,b){var c=a.find(".tms-pagination");c.find(".active").removeClass("active"),c.find("#tms-pagination-"+b).addClass("active")},q=function(b,d){var e;return e=a(c).width()>=768&&a(c).width()<=959&&d.carouselVisible>3?3:a(c).width()>=480&&a(c).width()<=767&&d.carouselVisible>2?2:a(c).width()<=479?1:d.carouselVisible},r=function(b,c,d){if(!c.carousel)return!1;var e,f,g=b.find(".tms-slides"),h=b.find("li.active"),i=h.index(),j=b.find(".tms-pagination"),k=g.children().length,l=q(b,c),m=b.width()/l,n=0,o=null;g.children().each(function(b){c.carouselVisible=0===c.carouselVisible?1:c.carouselVisible,a(this).css({width:m+"px",opacity:1,visibility:"visible"}),n=n>a(this).outerHeight()?n:a(this).outerHeight()}),2===l&&i>g.children().length-2?(e=g.children().length-1,f=!0):3===l&&i>g.children().length-3?(e=g.children().length-2,f=!0):i>g.children().length-l?(e=g.children().length-l+1,f=!0):(e=i,f=!1),j.children().hide().slice(0,g.children().length-l+1).show(),f&&(h.removeClass("active"),g.find("li:nth-child("+e+")").addClass("active"),p(b,e)),E?(b.data("transitioning")||g.css({width:m*k+"px",transition:"none",transform:"translate3d("+-(m*e)+"px, 0, 0)"}),clearTimeout(o),o=setTimeout(function(){g.css({transitionProperty:"opacity, "+H,transitionDuration:c.speed+"ms"})},50)):g.css({width:m*k+"px",left:-(m*e)+"px"})},s=function(b,d){var e=b.closest(".tm-slider-container, .featured-media"),f=e.parent().width(),g=d.fsUseHeightOf?d.fsUseHeightOf.height():a(c).height(),h=e.data("refW"),i=e.data("refH"),j=d.fullscreen?a(c).width()/g:h/i,k=e.data("external-padding")?e.data("external-padding"):d.externalPadding;k=a.isNumeric(k)?k:2*parseFloat(a(k).css("padding"));var l=d.fullscreen||d.fullwidth?a(c).width()-k:f,m=d.fullscreen?g-k:d.carousel&&d.carouselVisible>1&&!d.carouselScaleHeight?i:d.fullwidth&&f/j>i?i-k:f/j-k,n=m<=d.scaleMinHeight,o=n?l/d.scaleMinHeight:l/m,p=!(!d.carouselScaleHeight||1!==d.carouselVisible),q=d.forceFit||b.hasClass("tms-forcefit");if(e.data("newSW",l),e.data("newSH",m),d.carousel){var r=null;clearTimeout(r),e.css({width:Math.round(l)+"px"}),r=setTimeout(function(){e.css({height:e.data("scale-first")&&p?e.find("li:first-child").find(".tms-content-scalable, img").outerHeight()+"px":!e.data("scale-first")&&p?b.find(".tms-content-scalable, img").outerHeight():"auto"})},100)}else e.css({width:Math.round(l)+"px",height:m>d.scaleMinHeight||"auto"===d.scaleMinHeight?Math.round(m)+"px":d.scaleMinHeight+"px"}),d.parallax&&e.parent().css({height:e.height()+"px"}),m=m>d.scaleMinHeight||"auto"===d.scaleMinHeight?m:d.scaleMinHeight,e.data("newSH",m);if(!e.data("setup")||d.carousel&&d.carouselVisible>1)return!1;var s=b.is("[data-image]")?"image":"video",u=!!(b.is("[data-video-bkg]")||b.is("[data-video-bkg-youtube]")||b.is("[data-video-bkg-vimeo]")),v=b.is("[data-video-ratio]")?parseFloat(b.data("video-ratio")):1.778;b.find("img, iframe, video, .mejs-container").not(".tms-caption img, .tms-caption iframe, .tms-caption video").each(function(){var c,e,f,g=50,h=m+g,i=l+g;if("image"===s?(c=a(this).width(),e=a(this).height()):"video"===s&&((!d.respectRatio&&!u||d.fullscreen&&!u)&&b.addClass("tms-video-no-ratio"),u?(c=d.fullscreen&&d.fullwidth?h*v:l,e=d.fullscreen&&d.fullwidth?h:l/v):(c=a(this).attr("width")&&l>a(this).attr("width")?a(this).attr("width"):l,e=q?c/v:c/v)),f=c/e,"image"===s&&d.fullscreen||q||"video"===s&&u){if(a(this).is("img")&&!a(this).data("loaded"))return!1;o>f?a(this).css({width:u?i+"px":d.fullwidth&&!q?"auto":l+"px",height:u?Math.round(i/f)+"px":Math.round(l/f)+"px",top:u?Math.floor((m-e)/2)+"px":Math.round(-((l/f-m)/2))+"px",left:u?-(g/2)+"px":0}):a(this).css({width:!d.fullwidth||q||u?Math.round(m*f)+"px":"auto",height:m+"px",top:0,left:Math.round(-((m*f-l)/2))+"px"})}else"video"===s&&a(this).css({width:Math.floor(c)+"px",height:Math.floor(e)+"px",top:Math.floor((m-e)/2)+"px",left:Math.floor((l-c)/2)+"px"})}),t(b,d)},t=function(b,c){var d=b.closest(".tm-slider-container"),e=d.data("newSW"),f=d.data("newSH"),g=d.data("refW"),h=d.data("refH");return!(!c.captionScaling||c.carouselVisible>1)&&void b.find(".tms-caption").each(function(){if(!a(this).is("[data-no-scale]")){var b=a(this),d=b.data("x"),i=b.data("y"),j=b.data("w"),k=b.data("pt"),l=b.data("pr"),m=b.data("pb"),n=b.data("pl"),o=b.data("mt"),p=b.data("mr"),q=b.data("mb"),r=b.data("ml"),s=b.data("bt"),t=b.data("br"),u=b.data("bb"),v=b.data("bl"),w=b.data("fs"),x=0===b.data("lh")?w:b.data("lh"),y=b.is("[data-offsetx]")?parseFloat(b.data("offsetx")):0,z=b.is("[data-offsety]")?parseFloat(b.data("offsety")):0,A=e*(y/g)<0?e*(y/g):e*(y/g)>y?y:e*(y/g),B=f*(z/h)<0?e*(z/g):e*(z/g)>z?z:f*(z/h);c.fullwidth&&Bj?j:e*(j/g)>e?e:e*(j/g)),b.find("img").length||b.find("iframe, video").length?b.css({width:C+"px",height:b.children("iframe, video").length?C/1.778+"px":"auto"}):b.css({fontSize:e*(w/g)>w?w:e*(w/g)+"px",lineHeight:e*(x/g)>x?x+"px":e*(x/g)+"px",paddingTop:e*(k/g)>k?k:e*(k/g)+"px",paddingRight:e*(l/g)>l?l:e*(l/g)+"px",paddingBottom:e*(m/g)>m?m:e*(m/g)+"px",paddingLeft:e*(n/g)>n?n:e*(n/g)+"px",marginTop:e*(o/g)>o?o:e*(o/g)+"px",marginRight:e*(p/g)>p?p:e*(p/g)+"px",marginBottom:e*(q/g)>q?q:e*(q/g)+"px",marginLeft:e*(r/g)>r?r:e*(r/g)+"px",borderTopWidth:e*(s/g)>s?s:Math.ceil(e*(s/g))+"px",borderRightWidth:e*(t/g)>t?t:Math.ceil(e*(t/g))+"px",borderBottomWidth:e*(u/g)>u?u:Math.ceil(e*(u/g))+"px",borderLeftWidth:e*(v/g)>v?v:Math.ceil(e*(v/g))+"px",whiteSpace:"nowrap"}),b.css({top:"top"===i?0+B:"bottom"===i?f-b.outerHeight()-B:(f-b.outerHeight())/2+B+"px",left:"left"===d?0+A:"right"===d?e-b.outerWidth()-A:(e-b.outerWidth())/2+A+"px"})}})},u=function(b,c){return!(c.carouselVisible>1)&&void b.find(".tms-caption").not(".no-transition").each(function(){var b=a(this),c=b.data("o")?parseFloat(b.data("o")):0,d=b.data("tx")?parseFloat(b.data("tx")):0,e=b.data("ty")?parseFloat(b.data("ty")):0,f=b.data("tz")?parseFloat(b.data("tz")):0,g=b.data("rx")?parseFloat(b.data("rx")):0,h=b.data("ry")?parseFloat(b.data("ry")):0,i=b.data("rz")?parseFloat(b.data("rz")):0,j=b.data("s")?parseFloat(b.data("s")):1;E?b.css({transition:"none",transform:"translate3d("+d+"px, "+e+"px, "+f+"px )rotateX("+g+"deg) rotateY("+h+"deg) rotateZ("+i+"deg) scale3d("+j+", "+j+", "+j+")",opacity:c}):b.css({opacity:0})})},v=function(b,c,d){if(!d.useVideoAPI||d.carouselVisible>1)return!1;var e;try{if(b.find("iframe").length){e="#"+b.find("iframe").attr("id");var f=a(e).attr("src");"undefined"!=typeof f&&f.indexOf("vimeo")>-1?(e=$f(a(e)[0]),"play"===c&&d.autoPlay?e.api("play"):e.api("pause")):"undefined"!=typeof f&&f.indexOf("youtu")>-1&&(e=e.replace("#",""),"play"===c&&d.autoPlay?w[e].playVideo():w[e].stopVideo())}else b.find("video").length&&(e="#"+b.find("video").attr("id"),"play"===c&&d.autoPlay?a(e)[0].play():a(e)[0].pause())}catch(a){}},w={},x=!1,y=!1,z=function(d,e,f){if(!f.useVideoAPI||f.carouselVisible>1)return!1;var g=e.closest("li"),i=e.attr("src"),j=new Date;if(e.attr("id","video-"+j.getTime()),"undefined"!=typeof i&&i.indexOf("vimeo")>-1){if(e.attr("src",e.attr("src")+"&player_id="+e.attr("id")).addClass("vimeo"),g.is("[data-video-bkg-vimeo]")&&e.attr("src",e.attr("src")+"&autoplay=0&title=0&byline=0&portrait=0&badge=0&background=1").addClass("vimeo"),!x){x=!0;var k=b.createElement("script");k.src="http://a.vimeocdn.com/js/froogaloop2.min.js";var l=b.getElementsByTagName("script")[0];l.parentNode.insertBefore(k,l)}e.on("load",function(){var b=a(this),c="#"+b.attr("id"),e=$f(a(c)[0]),g=b.closest("li"),i=!!g.is(":first-child");e.addEvent("ready",function(){i&&f.autoPlay&&e.api("play"),e.api("setVolume",1),(f.muteBkgVideo||g.is("[data-mute-video]"))&&e.api("setVolume",0),e.addEvent("playProgress",function(a){h(d,g,f),g.addClass("video-bkg-loaded"),o(g,f)}),e.addEvent("finish",function(){f.replayOnEnd&&e.api("play")})})})}else if("undefined"!=typeof i&&i.indexOf("youtu")>-1){if(e.addClass("youtube"),g.is("[data-video-bkg-youtube]")&&e.attr("src",e.attr("src")+"&controls=0&showinfo=0&rel=0&modestbranding=0&loop=1&iv_load_policy=3&playlist="+e.attr("src").split("embed/")[1].substring(0,11)).addClass("youtube"),a("body").hasClass("safari-browser")&&g.hasClass("active")&&(e.attr("src",e.attr("src")+"&autoplay=1"),h(d,g,f),g.addClass("video-bkg-loaded"),o(g,f)),!y){y=!0;var m=b.createElement("script");m.src="http://www.youtube.com/player_api";var n=b.getElementsByTagName("script")[0];n.parentNode.insertBefore(m,n)}var p=function(){a(".youtube").each(function(){var b=a(".youtube"),c=b.attr("id"),e=b.closest("li"),g=!!e.is(":first-child");w[c]=new YT.Player(c,{events:{onStateChange:function(a){a.data===YT.PlayerState.PLAYING&&e.is("[data-video-bkg-youtube]")&&!L&&(h(d,e,f),e.addClass("video-bkg-loaded"),o(e,f)),a.data===YT.PlayerState.ENDED&&f.replayOnEnd&&w[c].playVideo()},onReady:function(a){g&&f.autoPlay&&w[c].playVideo(),(f.muteBkgVideo||e.is("[data-mute-video]"))&&w[c].mute()},onError:function(a){2===a.data?console.log("Avalance Slider - YouTube Video: Check video ID"):100===a.data?console.log("Avalance Slider - YouTube Video: Video not found"):101!==a.data&&150!==a.data||console.log("Avalance Slider - YouTube Video: Owner does not allow this video to be played as an embeded video"),b.hide(),h(d,e,f),e.addClass("error"),o(e,f)}}})})};c.onYouTubePlayerAPIReady=function(){p()}}else if(e.is("video")){e.addClass("html5-video");var q=b.getElementById(e.attr("id")),r=!!g.is(":first-child");r&&f.autoPlay&&(q.load(),q.autoplay=!0),(f.muteBkgVideo||g.is("[data-mute-video]"))&&(q.muted=f.muteBkgVideo),f.replayOnEnd&&(q.loop=!0)}},A=function(){var a={};return function(b,c,d){d||(d="id"),a[d]&&clearTimeout(a[d]),a[d]=setTimeout(b,c)}}();c.isRetinaDevice=function(){var a="(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)";return!!(this.devicePixelRatio>1||this.matchMedia&&this.matchMedia(a).matches)};var B,C=b.body||b.documentElement,D=C.style,E=D.transition!==d||D.WebkitTransition!==d||D.MozTransition!==d||D.MsTransition!==d||D.OTransition!==d,F=["WebkitTransform","MozTransform","OTransform","msTransform"];for(var G in F)D[F[G]]!==d&&(B="-"+F[G].replace("Transform","").toLowerCase());var H=B+"-transform",I="webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",J={linear:"cubic-bezier(0, 0, 1, 1)",swing:"cubic-bezier(0.42, 0, 0.58, 1)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)",easeFastSlow:"cubic-bezier(.11,.69,.66,1.01)",easeBounceBack:"cubic-bezier(.16,1.36,.57,.96)",easeBounceBackHard:"cubic-bezier(.8,1.91,0,.94)",easeBounceIn:"cubic-bezier(.15,2.6,0,-0.2)",easeSwingInOut:"cubic-bezier(.35,3.8,0.3,-0.6)"},K={fadeIn:"opacity: 0;easing: swing;",slideInUpShort:"opacity:0;transY: 50px;easing:easeFastSlow;",slideInRightShort:"opacity:0;transX: 50px;easing:easeFastSlow;",slideInDownShort:"opacity:0;transY: -50px;easing:easeFastSlow;",slideInLeftShort:"opacity:0;transX: -50px;easing:easeFastSlow;",slideInUpLong:"opacity:0;transY: 250px;easing:easeFastSlow;",slideInRightLong:"opacity:0;transX: 250px;easing:easeFastSlow;",slideInDownLong:"opacity:0;transY: -250px;easing:easeFastSlow;",slideInLeftLong:"opacity:0;transX: -250px;easing:easeFastSlow;",bounceIn:"opacity:0;scale:0.7;easing:easeBounceIn;",bounceOut:"opacity:0;scale:1.4;easing:easeBounceIn;",bounceInUp:"opacity:0;transY: 250px;easing:easeBounceIn;",bounceInRight:"opacity:0;transX: 250px;easing:easeBounceIn;",bounceInDown:"opacity:0;transY: -250px;easing:easeBounceIn;",bounceInLeft:"opacity:0;transX: -250px;easing:easeBounceIn;",scaleIn:"opacity:0;scale: 0.6;easing:easeFastSlow;",scaleOut:"opacity:0;scale: 1.4;easing:easeFastSlow",flipInX:"opacity:0;rotateX: -180deg;easing:easeFastSlow;",flipInY:"opacity:0;rotateY: -180deg;easing:easeFastSlow;",spinInX:"opacity:0;rotateX: -540deg;easing:easeFastSlow;",spinInY:"opacity:0;rotateY: -540deg;easing:easeFastSlow;",helicopterIn:"opacity:0;scale: 0.6;rotateZ: -360deg;easing:easeFastSlow;", helicopterOut:"opacity:0;scale: 1.4;rotateZ: -360deg;easing:easeFastSlow;",signSwingTop:"opacity:0;rotateX:-60deg;transOrigX:top;transOrigY:center;easing:easeSwingInOut;",signSwingRight:"opacity:0;rotateY:-60deg;transOrigX:right;transOrigY:center;easing:easeSwingInOut;",signSwingBottom:"opacity:0;rotateX:-60deg;transOrigX:bottom;transOrigY:center;easing:easeSwingInOut;",signSwingLeft:"opacity:0;rotateY:-60deg;transOrigX:left;transOrigY:center;easing:easeSwingInOut;",wiggleX:"opacity:0;rotateX:-90deg;transOrigX:center;transOrigY:center;easing:easeSwingInOut;",wiggleY:"opacity:0;rotateY:-90deg;transOrigX:center;transOrigY:center;easing:easeSwingInOut;",dropUp:"opacity:0;transY: 250px;rotateZ:60deg;transOrigX:left;transOrigY:top;easing:easeBounceBackHard;",dropDown:"opacity:0;transY: -250px;rotateZ:-60deg;transOrigX:left;transOrigY:top;easing:easeBounceBackHard;",rollInLeft:"opacity:0;transX: -250px;transY: 200px;rotateZ: -120px;transOrigX:left;transOrigY:top;easing:easeFastSlow;",rollInRight:"opacity:0;transX: 250px;transY: 200px;rotateZ: 120px;transOrigX:right;transOrigY:top;easing:easeFastSlow;",turnInRight:"opacity:0;transX: 250px;rotateX:20deg;rotateY:75deg;transOrigX:left;transOrigY:top;easing:easeBounceBack;",turnInLeft:"opacity:0;transX: -250px;rotateX:20deg;rotateY:-75deg;transOrigX:right;transOrigY:top;easing:easeBounceBack;"},L=!1;(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i))&&(L=!0),function(){for(var a=0,b=["ms","moz","webkit","o"],d=0;d
');var l=t("#tm-lightbox"),c=t("#tml-content-wrapper"),h=t("#tml-content"),p=null;l.addClass(n.auxClasses.replace(/,/g," ")),o.is("[data-modal-mode]")&&(l.addClass("tml-modal-mode"),h.addClass("modal-dialog"),t("body").addClass("modal-open"),o.data("modal-width")&&l.data("modal-width",o.data("modal-width")),o.data("modal-height")&&l.data("modal-height",o.data("modal-height"))),l.data("initLoad",!0);var v=n.contentMargin;if(c.css({top:v+"%",right:v+"%",bottom:v+"%",left:v+"%"}),e.length<2||h.swipeIt({preventTouchOn:".scrollable-content",onSwipeMove:function(t){h.css({left:t+"px"})},onSwipeEnd:function(t){"left"===t?s.prevContent():s.nextContent()}}),n.overlay||l.css({background:"none"}),n.navArrows&&e.length>=2){var f=t('
').attr("id","tml-prev").addClass("tml-nav").appendTo(l),g=t('').attr("id","tml-next").addClass("tml-nav").appendTo(l);f.on("click",function(t){t.preventDefault(),s.prevContent()}),g.on("click",function(t){t.preventDefault(),s.nextContent()})}if(n.navExit){var x;x=t('').appendTo(l.hasClass("tml-modal-mode")?h:l),x.on("click",function(t){t.preventDefault(),s.destroyLightbox()})}if(n.navToolbar){var y,C,z,k=600,T=400,A=t(i).height()/2-T/2,I=t(i).width()/2-k/2,S=t(location).attr("href"),O=t('
').appendTo(l),L=(o.data("toolbar")+"").split(";");if(n.navZoom=o.is("[data-toolbar]")?t.inArray("zoom",L)>-1?!0:!1:n.navZoom,n.navShare=o.is("[data-toolbar]")?t.inArray("share",L)>-1?!0:!1:n.navShare,n.navZoom&&(C=t('').appendTo(O),C.on("click",function(t){t.preventDefault(),c.toggleClass("zoomed"),m(n)})),n.navShare){var M=o.is("[data-list-vertical]")?"list-vertical":"list-horizontal";z=t('
').appendTo(O);var E=o.data("networks")?(o.data("networks")+"").split(";"):n.navNetworks.split(",");t.each(E,function(t,a){z.find("ul").append("
  • '+a+"
  • ")}),z.children("a").on("click",function(t){t.preventDefault(),z.children("ul").toggleClass("active")}),z.find("ul a").on("click",function(a){a.preventDefault();var e=o.data("caption"),n=o.data("twitter-user")?o.data("twitter-user"):"",r=o.data("image-url")?o.data("image-url"):o.attr("href");return t(this).is("[data-facebook]")?y="https://www.facebook.com/sharer/sharer.php?u="+S+",sharer":t(this).is("[data-twitter]")?y="https://twitter.com/intent/tweet?url="+r+"&via="+n:t(this).is("[data-pinterest]")&&(y="http://pinterest.com/pin/create/button/?url="+S+"&media="+r+"&description="+e),i.open(y,"popup","width="+k+",height="+T+", scrollbars=yes, top="+A+",left="+I),!1})}}n.navKeyboard&&t(a).on("keyup",function(t){37!=t.keyCode||e.length<2?39!=t.keyCode||e.length<2?27==t.keyCode&&s.destroyLightbox():s.nextContent():s.prevContent()}),n.overlayClickClose&&l.on("click",function(t){(t.target===this||"tml-content-wrapper"===t.target.id)&&s.destroyLightbox()});var D=r(l,n);if(b){if(l.css({transition:"none",transform:"translate3d("+D.x+"px, "+D.y+"px, 0px)"}),l.data("transitioning"))return!1;clearTimeout(p),p=setTimeout(function(){l.one(w,function(){d(t(".tml-active"),"next",n)}),u(l,1,0,0,n)},50)}else l.css({left:D.x+"px",top:D.y+"px"}),l.animate({opacity:1,left:0,top:0},n.speed,n.easing,function(){d(t(".tml-active"),"next",n)})},l=function(a,i,e){var n=(t("#tm-lightbox"),t("#tml-content"));n.data("loading",!0);var o="fade"===e.contentAnimation?0:e.slideAmount;if(i="next"===i?1:-1,b)n.one(w,function(){t(this).css({visibility:"hidden"}),d(a,i,e)}),u(n,0,-o*i,0,e);else{var r=n.position().left;n.animate({opacity:0,left:r-o*i+"px"},e.speed,e.easing,function(){t(this).css({visibility:"hidden"}),d(a,i,e)})}},d=function(a,e,n){var o=t("#tm-lightbox"),r=t("#tml-content"),s=t("#tml-exit").clone(!0),l=o.hasClass("tml-modal-mode")?!0:!1;r.find("iframe").attr("src",""),r.removeClass("tml-error scrollable-content").data("type","").html("");var d=a.attr("href"),m=d.match(/\.(jpeg|jpg|png|gif)/i),u=d.match(/(vimeo\.com|youtu(be\.com|\.be))\/(watch\?v=)?([A-Za-z0-9._%-]*)(\&\S+)?/),h=a.is('[data-content="inline"]'),p=a.is('[data-content="iframe"]'),v=a.is('[data-content="ajax"]');if(t("#tml-loader").length&&t("#tml-loader").remove(),o.append('
    '),m){var f=d.substr(d.lastIndexOf("."));(i.isRetinaDevice()&&n.retinaSupport||i.isRetinaDevice()&&a.is("[data-retina]"))&&(!z&&!n.retinaSupportMobile||z&&n.retinaSupportMobile)&&(d.match(/\.(svg)/i)||(d=a.data("retina")?a.data("retina"):d.replace(f,n.retinaSuffix+f))),r.data("type","img"),t("").addClass("tml-image").attr("src",d).one("load",function(){r.html(t(this)),c(!0,e,n)}).each(function(){this.complete&&t(this).trigger("load")}).on("error",function(){c(!1,e,n)})}if(u){r.data("type","video");var b=t('