function initDropDownMenus(){function mouseenter(){$(this).addClass("hovered")}function mouseleave(){$(this).removeClass("hovered")}var $submenus=$(".main-menu > ul > li .nav-2"),config;$submenus.length!=0&&(config={sensitivity:2,interval:100,over:mouseenter,timeout:200,out:mouseleave},$submenus.parent().hoverIntent(config),initThreeLevelDropDownMenu())}function initThreeLevelDropDownMenu(){var totalSiteWidth=960,totalThreshold=30,$topLi=$(".threeLevel");$topLi.length!=0&&$topLi.each(function(){var totalWidth=0;$(this).find(".level_3_ul").each(function(){totalWidth+=$(this).width()+1});totalWidth>totalSiteWidth-totalThreshold&&(totalWidth=totalSiteWidth);$(this).find(".submenu > li").width(totalWidth);var relPos=parseInt($(this).position().left)+1,availableSpace=totalSiteWidth-relPos,excess=availableSpace-totalWidth;excess<0&&(-excess>relPos&&(excess=-relPos),$(this).find(".submenu").css({left:excess}))})}function megaMenuUi(){$(".main-menu .nav-1>.hasChildren").hover(function(){$(this).hasClass("hovered")||($(this).addClass("hovered"),$("body").addClass("menu-open"));var pageHeight=$(document).height();$(".main-overlay").css("height",pageHeight);$("body").hasClass("mobile-search")&&$("body").trigger("search-close")},function(){$(this).hasClass("hovered")&&($(this).removeClass("hovered"),$("body").removeClass("menu-open"))})}function MobileMenuUi(){if(Modernizr.touch){$(".menu-trigger").on("click",function(){$(this).toggleClass("open");$("body").toggleClass("mobile-menu")});$("body").click(function(e){$(e.target).parents(".mobile-show .region-area-one .inner-area-one").length<=0&&$(e.target).parents(".mobile-show .region-area-two").length<=0&&($("body").removeClass("mobile-menu"),$(".menu-trigger").removeClass("open"),$(".mobile-show").removeClass("show-submenu"),$(".hasChildren").removeClass("active"))})}}function MobileSearchUi(){if(Modernizr.touch)$(".search-trigger").on("click",function(){$(".mobile-show .js-search-trigger").trigger("click")})}function MobileMainMenuUi(){Modernizr.touch&&($(".mobile-view > .nav-1 > li .submenu-handler").click(function(){$(".mobile-view .nav-1>li").removeClass("active");$(this).parents(".mobile-show").removeClass("show-submenu");$(this).parent().hasClass("hasChildren")&&($(this).parent().addClass("active"),$(this).parents(".mobile-show").addClass("show-submenu"))}),$(".back-link").click(function(){$(this).parents(".mobile-show").removeClass("show-submenu");$(this).parents(".hasChildren").removeClass("active")}))}function MobileSideMenu(){Modernizr.touch&&$(".document-menu.side-menu .nav-1 > .item0 > a").click(function(){event.preventDefault();var $categories=$(this).siblings(".nav-2");$(this).hasClass("open")||$categories.hasClass("expanded")?($(this).removeClass("open"),$categories.removeClass("expanded"),$categories.slideUp()):($(this).addClass("open"),$categories.addClass("expanded"),$categories.slideDown())})}function MobileFooterMenuUi(){if(Modernizr.touch){$(".footer-menu-trigger").on("click",function(){$(this).parents(".mobile-show").toggleClass("active");$("body").toggleClass("mobile-footer-menu")});$("body").click(function(e){$(e.target).parents(".mobile-show.footer-template-two .region-area-two").length<=0&&$(e.target).parents(".mobile-show.footer-template-two .region-area-one .inner-area-two").length<=0&&($("body").removeClass("mobile-footer-menu"),$(".mobile-show.footer-template-two").removeClass("active"))})}}function articleBoxHome(){if($(".home-control-area").length>0){$(document).on("click",".home-title",function(){var $masterParent=$(this).parents(".x-article-list"),$parent=$(this).parents("li");$parent.hasClass("active")?$masterParent.hasClass("open-panel")?($masterParent.removeClass("open-panel"),$("body").removeClass("home-panel"),$parent.removeClass("active")):($masterParent.addClass("open-panel"),$("body").addClass("home-panel"),$parent.addClass("active")):($parent.addClass("active").siblings().removeClass("active"),$masterParent.hasClass("open-panel")||($("body").addClass("home-panel"),$masterParent.addClass("open-panel")))});$("body").click(function(e){$(e.target).parents(".home-control-area").length<=0&&$(e.target).parents(".home-title").length<=0&&!$(e.target).hasClass("home-title")&&!$(e.target).hasClass("home-control-area")&&($(".x-article-list").removeClass("open-panel"),$("body").removeClass("home-panel"))});$(".home-control-area .text.close").click(function(){$(".home-page .region-area-six .x-article-list").removeClass("open-panel");$("body").removeClass("home-panel")});$(".x-article-box").on("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(e){EventManager.trigger("lazyload");e.stopPropagation();e.preventDefault()})}}function homeAlignCategoryBox(){if($(".home-page .x-article-box .home-title").length<=0)return!1;var _centerPage=$(window).width()/2,_elemWidth=$(".home-page .x-article-box .home-title").outerWidth(),_elemPad=20,_start=_centerPage-($(".home-page .x-article-box .home-title").outerWidth()*3/2+_elemPad/2);$(".home-page .x-article-box .home-title").each(function(){$(this).css("left",_start);_start=_start+_elemWidth+_elemPad/2})}function categoryListHome(){if($(".home-region .x-category-list").length<=0)return!1;$(".x-category-list > ul").owlCarousel({items:3,itemsDesktop:[1500,4],itemsDesktopSmall:[960,3],itemsTablet:[768,2],itemsMobile:[480,1],navigation:!0,navigationText:!1,pagination:!0,addClassActive:!0,responsiveRefreshRate:100})}function initMyAccountFunctions(){typeof InitMyAccountFunctions=="function"&&InitMyAccountFunctions()}function initCheckoutFunction(){typeof InitCheckoutFunctions=="function"&&InitCheckoutFunctions()}function initProductDetailsFunction(){typeof initProductDetails=="function"&&initProductDetails()}function initWaterInputs(){$(".waterInput").length<1||$(".waterInput").each(function(){var val=$(this).attr("data-name");$(this).watermark(val)})}function initClickableBackground(){$(".site-background .x-htmlarea ul li a").length<1||$(".site-container").click(function(e){$(e.target)[0]==$(".site-container")[0]&&(window.location=$(".site-background .x-htmlarea ul li a").attr("href"))})}function initDetailsThumbs(){$(".details-thumbs-carouzel").each(function(){var numOfItems=$(this).find("li").length;numOfItems>3&&($(this).siblings(".details-thumbs-next").addClass("shown"),$(this).siblings(".details-thumbs-prev").addClass("shown"),$(this).jCarouselLite({btnNext:$(this).siblings(".details-thumbs-next"),btnPrev:$(this).siblings(".details-thumbs-prev"),visible:3,start:0,scroll:3,circular:!1,easing:"easeInOutCubic",speed:700,vertical:!0}))})}function UpdateQueryString(key,value,url){var re,value,pos,separator,hash;return url||(url=window.location.href),re=new RegExp("([?|&])"+key+"=.*?(&|#|$)","gi"),url.match(re)?(value=value?url.replace(re,"$1"+key+"="+value+"$2"):url.replace(re,"$2"),value.indexOf("?")==-1&&(pos=value.indexOf("&"),pos!=-1&&(value=value.substring(0,pos-1)+"?"+value.substring(pos+1,value.length))),value):value?(separator=url.indexOf("?")!==-1?"&":"?",hash=url.split("#"),url=hash[0]+separator+key+"="+value,hash[1]&&(url+="#"+hash[1]),url):url}function getQueryStringValueByName(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)",regex=new RegExp(regexS),results=regex.exec(window.location.search);return results==null?"":decodeURIComponent(results[1].replace(/\+/g," "))}function removeValueFromCommaSeparatedString(list,value,separator){var values,i;for(separator=separator||",",values=list.split(separator),i=0;i57)&&event.preventDefault():(event.keyCode<96||event.keyCode>105)&&event.preventDefault())}function preventSpecialCharacter(e){var shiftPressed=e.shiftKey,keyCode=e.keyCode;shiftPressed?(keyCode==188||keyCode==190||keyCode==51||keyCode==55||keyCode==53||keyCode==219||keyCode==221)&&e.preventDefault():(keyCode==191||keyCode==219||keyCode==221||keyCode==111)&&e.preventDefault()}function phoneGROnly(event){numbersOnly(event);$(event.currentTarget).val().length>9&&(event.keyCode==46||event.keyCode==8||event.keyCode==36||event.keyCode==35||event.keyCode==37||event.keyCode==39||event.keyCode==9||event.preventDefault())}function rippleInit(){if($(".withripple").length<=0||Modernizr.touch)return!1;$(".withripple").ripples()}function loadedClass(){$("body").removeClass("menu-open");setTimeout(function(){$("body").addClass("loaded")},400)}function resolveAndRedirect(urlParams){var url="";(urlParams.category!=null&&(url=urlParams.category,$.each(urlParams,function(key,value){key!="category"&&(url=UpdateQueryString(key,value,url))})),url!="")&&(window.location=url)}function MediaFancyboxes(){$(".print-ads-page").length>0&&$(".x-article-box").each(function(){$(this).find(".x-videogallery").length<1?$(this).click(function(e){Modernizr.touch&&$(window).width()<768?e.preventDefault():$(".fancyboxgroup").fancybox({wrapCSS:"media-adds",nextEffect:"none",prevEffect:"none",padding:0,margin:[20,60,20,60]})}):$(this).click(function(){$(this).find(".is-video").fancybox({wrapCSS:"fancy-video",maxWidth:800,maxHeight:600,fitToView:!1,width:"70%",height:"70%",nextEffect:"none",prevEffect:"none",padding:0})})})}function ProductCategoryFilterScroll(){if($(".category-list-page").length>0){var filters=$(".filters"),filterWrapper=$(".filter",filters);$.each(filterWrapper,function(i,wrapper){var filterItems=$("ul > li a",$(wrapper));filterItems.hasClass("checked")&&($(".main-category").addClass("hidden"),$(".box-new").addClass("hidden"),$(this).closest(".filter").addClass("expanded"),$(".by-category").removeClass("open"),$(".by-category").siblings(".nav-2").removeClass("expanded"),$(".by-category").siblings(".nav-2").addClass("hidden"),$(".category-list-page").css({background:"none"}))})}}function initOwlGallery(){var $owlWrapperProducts=$(".owl-gallery-products");$("> ul > li",$owlWrapperProducts).length>4&&$owlWrapperProducts.addClass("slider-active");$("> ul",$owlWrapperProducts).owlCarousel({slideSpeed:1100,rewindSpeed:1100,navigation:!0,pagination:!1,addClassActive:!0,items:4,itemsDesktop:[1199,4],itemsDesktopSmall:[959,4],itemsTablet:[767,3],itemsMobile:[650,2],touchDrag:!0,mouseDrag:!0})}var processProductBox;(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY,track=function(ev){cX=ev.pageX;cY=ev.pageY},compare=function(ev,ob){if(ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t),Math.abs(pX-cX)+Math.abs(pY-cY)settings.failure_limit)return!1}else $this.trigger("appear"),counter=0})}var elements=this,$container,settings={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:window,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return options&&(undefined!==options.failurelimit&&(options.failure_limit=options.failurelimit,delete options.failurelimit),undefined!==options.effectspeed&&(options.effect_speed=options.effectspeed,delete options.effectspeed),$.extend(settings,options)),$container=settings.container===undefined||settings.container===window?$window:$(settings.container),0===settings.event.indexOf("scroll")&&$container.bind(settings.event,function(){return update()}),$container.bind("lazyload",function(){return update()}),this.each(function(){var self=this,$self=$(self);self.loaded=!1;($self.attr("src")===undefined||$self.attr("src")===!1)&&$self.is("img")&&$self.attr("src",settings.placeholder);$self.one("appear",function(){if(!this.loaded){if(settings.appear){var elements_left=elements.length;settings.appear.call(self,elements_left,settings)}$("").bind("load",function(){var original=$self.attr("data-"+settings.data_attribute),temp,elements_left;$self.hide();$self.is("img")?$self.attr("src",original):$self.css("background-image","url('"+original+"')");$self[settings.effect](settings.effect_speed);self.loaded=!0;temp=$.grep(elements,function(element){return!element.loaded});elements=$(temp);settings.load&&(elements_left=elements.length,settings.load.call(self,elements_left,settings))}).attr("src",$self.attr("data-"+settings.data_attribute))}});0!==settings.event.indexOf("scroll")&&$self.bind(settings.event,function(){self.loaded||$self.trigger("appear")})}),$window.bind("resize",function(){update()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&$window.bind("pageshow",function(event){event.originalEvent&&event.originalEvent.persisted&&elements.each(function(){$(this).trigger("appear")})}),$(document).ready(function(){update()}),this};$.belowthefold=function(element,settings){var fold;return fold=settings.container===undefined||settings.container===window?(window.innerHeight?window.innerHeight:$window.height())+$window.scrollTop():$(settings.container).offset().top+$(settings.container).height(),fold<=$(element).offset().top-settings.threshold};$.rightoffold=function(element,settings){var fold;return fold=settings.container===undefined||settings.container===window?$window.width()+$window.scrollLeft():$(settings.container).offset().left+$(settings.container).width(),fold<=$(element).offset().left-settings.threshold};$.abovethetop=function(element,settings){var fold;return fold=settings.container===undefined||settings.container===window?$window.scrollTop():$(settings.container).offset().top,fold>=$(element).offset().top+settings.threshold+$(element).height()};$.leftofbegin=function(element,settings){var fold;return fold=settings.container===undefined||settings.container===window?$window.scrollLeft():$(settings.container).offset().left,fold>=$(element).offset().left+settings.threshold+$(element).width()};$.inviewport=function(element,settings){return!$.rightoffold(element,settings)&&!$.leftofbegin(element,settings)&&!$.belowthefold(element,settings)&&!$.abovethetop(element,settings)};$.extend($.expr[":"],{"below-the-fold":function(a){return $.belowthefold(a,{threshold:0})},"above-the-top":function(a){return!$.belowthefold(a,{threshold:0})},"right-of-screen":function(a){return $.rightoffold(a,{threshold:0})},"left-of-screen":function(a){return!$.rightoffold(a,{threshold:0})},"in-viewport":function(a){return $.inviewport(a,{threshold:0})},"above-the-fold":function(a){return!$.belowthefold(a,{threshold:0})},"right-of-fold":function(a){return $.rightoffold(a,{threshold:0})},"left-of-fold":function(a){return!$.rightoffold(a,{threshold:0})}})}(jQuery,window,document); /*! * jQuery Cycle2 - Version: 20130709 * http://malsup.com/jquery/cycle2/ * Copyright (c) 2012 M. Alsup; Dual licensed: MIT/GPL * Requires: jQuery v1.7 or later */ (function($){"use strict";function lowerCase(s){return(s||"").toLowerCase()}var version="20130709";$.fn.cycle=function(options){var o;return this.length===0&&!$.isReady?(o={s:this.selector,c:this.context},$.fn.cycle.log("requeuing slideshow (dom not ready)"),$(function(){$(o.s,o.c).cycle(options)}),this):this.each(function(){var data,opts,shortName,val,container=$(this),log=$.fn.cycle.log,p;if(!container.data("cycle.opts")){(container.data("cycle-log")===!1||options&&options.log===!1||opts&&opts.log===!1)&&(log=$.noop);data=container.data();for(p in data)data.hasOwnProperty(p)&&/^cycle[A-Z]+/.test(p)&&(val=data[p],shortName=p.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,lowerCase),log(shortName+":",val,"("+typeof val+")"),data[shortName]=val);opts=$.extend({},$.fn.cycle.defaults,data,options||{});opts.timeoutId=0;opts.paused=opts.paused||!1;opts.container=container;opts._maxZ=opts.maxZ;opts.API=$.extend({_container:container},$.fn.cycle.API);opts.API.log=log;opts.API.trigger=function(eventName,args){return opts.container.trigger(eventName,args),opts.API};container.data("cycle.opts",opts);container.data("cycle.API",opts.API);opts.API.trigger("cycle-bootstrap",[opts,opts.API]);opts.API.addInitialSlides();opts.API.preInitSlideshow();opts.slides.length&&opts.API.initSlideshow()}})};$.fn.cycle.API={opts:function(){return this._container.data("cycle.opts")},addInitialSlides:function(){var opts=this.opts(),slides=opts.slides;opts.slideCount=0;opts.slides=$();slides=slides.jquery?slides:opts.container.find(slides);opts.random&&slides.sort(function(){return Math.random()-.5});opts.API.add(slides)},preInitSlideshow:function(){var opts=this.opts(),tx;opts.API.trigger("cycle-pre-initialize",[opts]);tx=$.fn.cycle.transitions[opts.fx];tx&&$.isFunction(tx.preInit)&&tx.preInit(opts);opts._preInitialized=!0},postInitSlideshow:function(){var opts=this.opts(),tx;opts.API.trigger("cycle-post-initialize",[opts]);tx=$.fn.cycle.transitions[opts.fx];tx&&$.isFunction(tx.postInit)&&tx.postInit(opts)},initSlideshow:function(){var opts=this.opts(),pauseObj=opts.container,slideOpts;opts.API.calcFirstSlide();opts.container.css("position")=="static"&&opts.container.css("position","relative");$(opts.slides[opts.currSlide]).css("opacity",1).show();opts.API.stackSlides(opts.slides[opts.currSlide],opts.slides[opts.nextSlide],!opts.reverse);opts.pauseOnHover&&(opts.pauseOnHover!==!0&&(pauseObj=$(opts.pauseOnHover)),pauseObj.hover(function(){opts.API.pause(!0)},function(){opts.API.resume(!0)}));opts.timeout&&(slideOpts=opts.API.getSlideOpts(opts.nextSlide),opts.API.queueTransition(slideOpts,slideOpts.timeout+opts.delay));opts._initialized=!0;opts.API.updateView(!0);opts.API.trigger("cycle-initialized",[opts]);opts.API.postInitSlideshow()},pause:function(hover){var opts=this.opts(),slideOpts=opts.API.getSlideOpts(),alreadyPaused=opts.hoverPaused||opts.paused;hover?opts.hoverPaused=!0:opts.paused=!0;alreadyPaused||(opts.container.addClass("cycle-paused"),opts.API.trigger("cycle-paused",[opts]).log("cycle-paused"),slideOpts.timeout&&(clearTimeout(opts.timeoutId),opts.timeoutId=0,opts._remainingTimeout-=$.now()-opts._lastQueue,(opts._remainingTimeout<0||isNaN(opts._remainingTimeout))&&(opts._remainingTimeout=undefined)))},resume:function(hover){var opts=this.opts(),alreadyResumed=!opts.hoverPaused&&!opts.paused;hover?opts.hoverPaused=!1:opts.paused=!1;alreadyResumed||(opts.container.removeClass("cycle-paused"),opts.slides.filter(":animated").length===0&&opts.API.queueTransition(opts.API.getSlideOpts(),opts._remainingTimeout),opts.API.trigger("cycle-resumed",[opts,opts._remainingTimeout]).log("cycle-resumed"))},add:function(slides,prepend){var opts=this.opts(),oldSlideCount=opts.slideCount,startSlideshow=!1,len;$.type(slides)=="string"&&(slides=$.trim(slides));$(slides).each(function(){var slideOpts,slide=$(this);prepend?opts.container.prepend(slide):opts.container.append(slide);opts.slideCount++;slideOpts=opts.API.buildSlideOpts(slide);opts.slides=prepend?$(slide).add(opts.slides):opts.slides.add(slide);opts.API.initSlide(slideOpts,slide,--opts._maxZ);slide.data("cycle.opts",slideOpts);opts.API.trigger("cycle-slide-added",[opts,slideOpts,slide])});opts.API.updateView(!0);startSlideshow=opts._preInitialized&&oldSlideCount<2&&opts.slideCount>=1;startSlideshow&&(opts._initialized?opts.timeout&&(len=opts.slides.length,opts.nextSlide=opts.reverse?len-1:1,opts.timeoutId||opts.API.queueTransition(opts)):opts.API.initSlideshow())},calcFirstSlide:function(){var opts=this.opts(),firstSlideIndex;firstSlideIndex=parseInt(opts.startingSlide||0,10);(firstSlideIndex>=opts.slides.length||firstSlideIndex<0)&&(firstSlideIndex=0);opts.currSlide=firstSlideIndex;opts.reverse?(opts.nextSlide=firstSlideIndex-1,opts.nextSlide<0&&(opts.nextSlide=opts.slides.length-1)):(opts.nextSlide=firstSlideIndex+1,opts.nextSlide==opts.slides.length&&(opts.nextSlide=0))},calcNextSlide:function(){var opts=this.opts(),roll;opts.reverse?(roll=opts.nextSlide-1<0,opts.nextSlide=roll?opts.slideCount-1:opts.nextSlide-1,opts.currSlide=roll?0:opts.nextSlide+1):(roll=opts.nextSlide+1==opts.slides.length,opts.nextSlide=roll?0:opts.nextSlide+1,opts.currSlide=roll?opts.slides.length-1:opts.nextSlide-1)},calcTx:function(slideOpts,manual){var opts=slideOpts,tx;return manual&&opts.manualFx&&(tx=$.fn.cycle.transitions[opts.manualFx]),tx||(tx=$.fn.cycle.transitions[opts.fx]),tx||(tx=$.fn.cycle.transitions.fade,opts.API.log('Transition "'+opts.fx+'" not found. Using fade.')),tx},prepareTx:function(manual,fwd){var opts=this.opts(),after,curr,next,slideOpts,tx;if(opts.slideCount<2){opts.timeoutId=0;return}(manual&&(!opts.busy||opts.manualTrump)&&(opts.API.stopTransition(),opts.busy=!1,clearTimeout(opts.timeoutId),opts.timeoutId=0),opts.busy)||(opts.timeoutId!==0||manual)&&(curr=opts.slides[opts.currSlide],next=opts.slides[opts.nextSlide],slideOpts=opts.API.getSlideOpts(opts.nextSlide),tx=opts.API.calcTx(slideOpts,manual),opts._tx=tx,manual&&slideOpts.manualSpeed!==undefined&&(slideOpts.speed=slideOpts.manualSpeed),opts.nextSlide!=opts.currSlide&&(manual||!opts.paused&&!opts.hoverPaused&&opts.timeout)?(opts.API.trigger("cycle-before",[slideOpts,curr,next,fwd]),tx.before&&tx.before(slideOpts,curr,next,fwd),after=function(){(opts.busy=!1,opts.container.data("cycle.opts"))&&(tx.after&&tx.after(slideOpts,curr,next,fwd),opts.API.trigger("cycle-after",[slideOpts,curr,next,fwd]),opts.API.queueTransition(slideOpts),opts.API.updateView(!0))},opts.busy=!0,tx.transition?tx.transition(slideOpts,curr,next,fwd,after):opts.API.doTransition(slideOpts,curr,next,fwd,after),opts.API.calcNextSlide(),opts.API.updateView()):opts.API.queueTransition(slideOpts))},doTransition:function(slideOpts,currEl,nextEl,fwd,callback){var opts=slideOpts,curr=$(currEl),next=$(nextEl),fn=function(){next.animate(opts.animIn||{opacity:1},opts.speed,opts.easeIn||opts.easing,callback)};next.css(opts.cssBefore||{});curr.animate(opts.animOut||{},opts.speed,opts.easeOut||opts.easing,function(){curr.css(opts.cssAfter||{});opts.sync||fn()});opts.sync&&fn()},queueTransition:function(slideOpts,specificTimeout){var opts=this.opts(),timeout=specificTimeout!==undefined?specificTimeout:slideOpts.timeout;if(opts.nextSlide===0&&--opts.loop==0){opts.API.log("terminating; loop=0");opts.timeout=0;timeout?setTimeout(function(){opts.API.trigger("cycle-finished",[opts])},timeout):opts.API.trigger("cycle-finished",[opts]);opts.nextSlide=opts.currSlide;return}timeout&&(opts._lastQueue=$.now(),specificTimeout===undefined&&(opts._remainingTimeout=slideOpts.timeout),opts.paused||opts.hoverPaused||(opts.timeoutId=setTimeout(function(){opts.API.prepareTx(!1,!opts.reverse)},timeout)))},stopTransition:function(){var opts=this.opts();opts.slides.filter(":animated").length&&(opts.slides.stop(!1,!0),opts.API.trigger("cycle-transition-stopped",[opts]));opts._tx&&opts._tx.stopTransition&&opts._tx.stopTransition(opts)},advanceSlide:function(val){var opts=this.opts();return clearTimeout(opts.timeoutId),opts.timeoutId=0,opts.nextSlide=opts.currSlide+val,opts.nextSlide<0?opts.nextSlide=opts.slides.length-1:opts.nextSlide>=opts.slides.length&&(opts.nextSlide=0),opts.API.prepareTx(!0,val>=0),!1},buildSlideOpts:function(slide){var opts=this.opts(),val,shortName,slideOpts=slide.data()||{},p;for(p in slideOpts)slideOpts.hasOwnProperty(p)&&/^cycle[A-Z]+/.test(p)&&(val=slideOpts[p],shortName=p.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,lowerCase),opts.API.log("["+(opts.slideCount-1)+"]",shortName+":",val,"("+typeof val+")"),slideOpts[shortName]=val);slideOpts=$.extend({},$.fn.cycle.defaults,opts,slideOpts);slideOpts.slideNum=opts.slideCount;try{delete slideOpts.API;delete slideOpts.slideCount;delete slideOpts.currSlide;delete slideOpts.nextSlide;delete slideOpts.slides}catch(e){}return slideOpts},getSlideOpts:function(index){var opts=this.opts(),slide,slideOpts;return index===undefined&&(index=opts.currSlide),slide=opts.slides[index],slideOpts=$(slide).data("cycle.opts"),$.extend({},opts,slideOpts)},initSlide:function(slideOpts,slide,suggestedZindex){var opts=this.opts();slide.css(slideOpts.slideCss||{});suggestedZindex>0&&slide.css("zIndex",suggestedZindex);isNaN(slideOpts.speed)&&(slideOpts.speed=$.fx.speeds[slideOpts.speed]||$.fx.speeds._default);slideOpts.sync||(slideOpts.speed=slideOpts.speed/2);slide.addClass(opts.slideClass)},updateView:function(isAfter){var opts=this.opts(),slideOpts,currSlide;opts._initialized&&((slideOpts=opts.API.getSlideOpts(),currSlide=opts.slides[opts.currSlide],!isAfter&&(opts.API.trigger("cycle-update-view-before",[opts,slideOpts,currSlide]),opts.updateView<0))||(opts.slideActiveClass&&opts.slides.removeClass(opts.slideActiveClass).eq(opts.currSlide).addClass(opts.slideActiveClass),isAfter&&opts.hideNonActive&&opts.slides.filter(":not(."+opts.slideActiveClass+")").hide(),opts.API.trigger("cycle-update-view",[opts,slideOpts,currSlide,isAfter]),opts.API.trigger("cycle-update-view-after",[opts,slideOpts,currSlide])))},getComponent:function(name){var opts=this.opts(),selector=opts[name];return typeof selector=="string"?/^\s*[\>|\+|~]/.test(selector)?opts.container.find(selector):$(selector):selector.jquery?selector:$(selector)},stackSlides:function(curr,next,fwd){var opts=this.opts(),i,z,len;if(curr||(curr=opts.slides[opts.currSlide],next=opts.slides[opts.nextSlide],fwd=!opts.reverse),$(curr).css("zIndex",opts.maxZ),z=opts.maxZ-2,len=opts.slideCount,fwd){for(i=opts.currSlide+1;i=0;i--)$(opts.slides[i]).css("zIndex",z--);for(i=len-1;i>opts.currSlide;i--)$(opts.slides[i]).css("zIndex",z--)}$(next).css("zIndex",opts.maxZ-1)},getSlideIndex:function(el){return this.opts().slides.index(el)}};$.fn.cycle.log=function(){window.console&&console.log&&console.log("[cycle2] "+Array.prototype.join.call(arguments," "))};$.fn.cycle.version=function(){return"Cycle2: "+version};$.fn.cycle.transitions={custom:{},none:{before:function(opts,curr,next,fwd){opts.API.stackSlides(next,curr,fwd);opts.cssBefore={opacity:1,display:"block"}}},fade:{before:function(opts,curr,next,fwd){var css=opts.API.getSlideOpts(opts.nextSlide).slideCss||{};opts.API.stackSlides(curr,next,fwd);opts.cssBefore=$.extend(css,{opacity:0,display:"block"});opts.animIn={opacity:1};opts.animOut={opacity:0}}},fadeout:{before:function(opts,curr,next,fwd){var css=opts.API.getSlideOpts(opts.nextSlide).slideCss||{};opts.API.stackSlides(curr,next,fwd);opts.cssBefore=$.extend(css,{opacity:1,display:"block"});opts.animOut={opacity:0}}},scrollHorz:{before:function(opts,curr,next,fwd){opts.API.stackSlides(curr,next,fwd);var w=opts.container.css("overflow","hidden").width();opts.cssBefore={left:fwd?w:-w,top:0,opacity:1,display:"block"};opts.cssAfter={zIndex:opts._maxZ-2,left:0};opts.animIn={left:0};opts.animOut={left:fwd?-w:w}}}};$.fn.cycle.defaults={allowWrap:!0,autoSelector:".cycle-slideshow[data-cycle-auto-init!=false]",delay:0,easing:null,fx:"fade",hideNonActive:!0,loop:0,manualFx:undefined,manualSpeed:undefined,manualTrump:!0,maxZ:100,pauseOnHover:!1,reverse:!1,slideActiveClass:"cycle-slide-active",slideClass:"cycle-slide",slideCss:{position:"absolute",top:0,left:0},slides:"> img",speed:500,startingSlide:0,sync:!0,timeout:4e3,updateView:-1};$(document).ready(function(){$($.fn.cycle.defaults.autoSelector).cycle()})})(jQuery); /*! Cycle2 autoheight plugin; Copyright (c) M.Alsup, 2012; version: 20130304 */ (function($){"use strict";function initAutoHeight(e,opts){var clone,height,sentinelIndex,autoHeight=opts.autoHeight;if(autoHeight=="container")height=$(opts.slides[opts.currSlide]).outerHeight(),opts.container.height(height);else if(opts._autoHeightRatio)opts.container.height(opts.container.width()/opts._autoHeightRatio);else if(autoHeight==="calc"||$.type(autoHeight)=="number"&&autoHeight>=0){if(sentinelIndex=autoHeight==="calc"?calcSentinelIndex(e,opts):autoHeight>=opts.slides.length?0:autoHeight,sentinelIndex==opts._sentinelIndex)return;opts._sentinelIndex=sentinelIndex;opts._sentinel&&opts._sentinel.remove();clone=$(opts.slides[sentinelIndex].cloneNode(!0));clone.removeAttr("id name rel").find("[id],[name],[rel]").removeAttr("id name rel");clone.css({position:"static",visibility:"hidden",display:"block"}).prependTo(opts.container).addClass("cycle-sentinel cycle-slide").removeClass("cycle-slide-active");clone.find("*").css("visibility","hidden");opts._sentinel=clone}}function calcSentinelIndex(e,opts){var index=0,max=-1;return opts.slides.each(function(i){var h=$(this).height();h>max&&(max=h,index=i)}),index}function onBefore(e,opts,outgoing,incoming){var h=$(incoming).outerHeight(),duration=opts.sync?opts.speed/2:opts.speed;opts.container.animate({height:h},duration)}function onDestroy(e,opts){opts._autoHeightOnResize&&($(window).off("resize orientationchange",opts._autoHeightOnResize),opts._autoHeightOnResize=null);opts.container.off("cycle-slide-added cycle-slide-removed",initAutoHeight);opts.container.off("cycle-destroyed",onDestroy);opts.container.off("cycle-before",onBefore);opts._sentinel&&(opts._sentinel.remove(),opts._sentinel=null)}$.extend($.fn.cycle.defaults,{autoHeight:0});$(document).on("cycle-initialized",function(e,opts){function onResize(){initAutoHeight(e,opts)}var autoHeight=opts.autoHeight,t=$.type(autoHeight),resizeThrottle=null,ratio;if(t==="string"||t==="number"){opts.container.on("cycle-slide-added cycle-slide-removed",initAutoHeight);opts.container.on("cycle-destroyed",onDestroy);if(autoHeight=="container")opts.container.on("cycle-before",onBefore);else t==="string"&&/\d+\:\d+/.test(autoHeight)&&(ratio=autoHeight.match(/(\d+)\:(\d+)/),ratio=ratio[1]/ratio[2],opts._autoHeightRatio=ratio);if(t!=="number"){opts._autoHeightOnResize=function(){clearTimeout(resizeThrottle);resizeThrottle=setTimeout(onResize,50)};$(window).on("resize orientationchange",opts._autoHeightOnResize)}setTimeout(onResize,30)}})})(jQuery); /*! caption plugin for Cycle2; version: 20130306 */ (function($){"use strict";$.extend($.fn.cycle.defaults,{caption:"> .cycle-caption",captionTemplate:"{{slideNum}} / {{slideCount}}",overlay:"> .cycle-overlay",overlayTemplate:"
{{title}}<\/div>
{{desc}}<\/div>",captionModule:"caption"});$(document).on("cycle-update-view",function(e,opts,slideOpts,currSlide){if(opts.captionModule==="caption")$.each(["caption","overlay"],function(){var name=this,template=slideOpts[name+"Template"],el=opts.API.getComponent(name);el.length&&template?(el.html(opts.API.tmpl(template,slideOpts,opts,currSlide)),el.show()):el.hide()})});$(document).on("cycle-destroyed",function(e,opts){var el;$.each(["caption","overlay"],function(){var name=this,template=opts[name+"Template"];opts[name]&&template&&(el=opts.API.getComponent("caption"),el.empty())})})})(jQuery); /*! command plugin for Cycle2; version: 20130707 */ (function($){"use strict";var c2=$.fn.cycle;$.fn.cycle=function(options){var cmd,cmdFn,opts,args=$.makeArray(arguments);return $.type(options)=="number"?this.cycle("goto",options):$.type(options)=="string"?this.each(function(){var cmdArgs;if(cmd=options,opts=$(this).data("cycle.opts"),opts===undefined){c2.log('slideshow must be initialized before sending commands; "'+cmd+'" ignored');return}if(cmd=cmd=="goto"?"jump":cmd,cmdFn=opts.API[cmd],$.isFunction(cmdFn))return cmdArgs=$.makeArray(args),cmdArgs.shift(),cmdFn.apply(opts.API,cmdArgs);c2.log("unknown command: ",cmd)}):c2.apply(this,arguments)};$.extend($.fn.cycle,c2);$.extend(c2.API,{next:function(){var opts=this.opts(),count;(!opts.busy||opts.manualTrump)&&((count=opts.reverse?-1:1,opts.allowWrap===!1&&opts.currSlide+count>=opts.slideCount)||(opts.API.advanceSlide(count),opts.API.trigger("cycle-next",[opts])))},prev:function(){var opts=this.opts(),count;(!opts.busy||opts.manualTrump)&&((count=opts.reverse?1:-1,opts.allowWrap===!1&&opts.currSlide+count<0)||(opts.API.advanceSlide(count),opts.API.trigger("cycle-prev",[opts])))},destroy:function(){this.stop();var opts=this.opts(),clean=$.isFunction($._data)?$._data:$.noop;clearTimeout(opts.timeoutId);opts.timeoutId=0;opts.API.stop();opts.API.trigger("cycle-destroyed",[opts]).log("cycle-destroyed");opts.container.removeData();clean(opts.container[0],"parsedAttrs",!1);opts.retainStylesOnDestroy||(opts.container.removeAttr("style"),opts.slides.removeAttr("style"),opts.slides.removeClass(opts.slideActiveClass));opts.slides.each(function(){$(this).removeData();clean(this,"parsedAttrs",!1)})},jump:function(index){var fwd,opts=this.opts(),num;if(!opts.busy||opts.manualTrump){if(num=parseInt(index,10),isNaN(num)||num<0||num>=opts.slides.length){opts.API.log("goto: invalid slide index: "+num);return}if(num==opts.currSlide){opts.API.log("goto: skipping, already on slide",num);return}opts.nextSlide=num;clearTimeout(opts.timeoutId);opts.timeoutId=0;opts.API.log("goto: ",num," (zero-index)");fwd=opts.currSlide .cycle-pager",pagerActiveClass:"cycle-pager-active",pagerEvent:"click.cycle",pagerTemplate:"•<\/span>"});$(document).on("cycle-bootstrap",function(e,opts,API){API.buildPagerLink=buildPagerLink});$(document).on("cycle-slide-added",function(e,opts,slideOpts,slideAdded){opts.pager&&(opts.API.buildPagerLink(opts,slideOpts,slideAdded),opts.API.page=page)});$(document).on("cycle-slide-removed",function(e,opts,index){if(opts.pager){var pagers=opts.API.getComponent("pager");pagers.each(function(){var pager=$(this);$(pager.children()[index]).remove()})}});$(document).on("cycle-update-view",function(e,opts){var pagers;opts.pager&&(pagers=opts.API.getComponent("pager"),pagers.each(function(){$(this).children().removeClass(opts.pagerActiveClass).eq(opts.currSlide).addClass(opts.pagerActiveClass)}))});$(document).on("cycle-destroyed",function(e,opts){var pager=opts.API.getComponent("pager");pager&&(pager.children().off(opts.pagerEvent),opts.pagerTemplate&&pager.empty())})})(jQuery); /*! prevnext plugin for Cycle2; version: 20130709 */ (function($){"use strict";$.extend($.fn.cycle.defaults,{next:"> .cycle-next",nextEvent:"click.cycle",disabledClass:"disabled",prev:"> .cycle-prev",prevEvent:"click.cycle",swipe:!1});$(document).on("cycle-initialized",function(e,opts){opts.API.getComponent("next").on(opts.nextEvent,function(e){e.preventDefault();opts.API.next()});opts.API.getComponent("prev").on(opts.prevEvent,function(e){e.preventDefault();opts.API.prev()});if(opts.swipe){var nextEvent=opts.swipeVert?"swipeUp.cycle":"swipeLeft.cycle swipeleft.cycle",prevEvent=opts.swipeVert?"swipeDown.cycle":"swipeRight.cycle swiperight.cycle";opts.container.on(nextEvent,function(){opts.API.next()});opts.container.on(prevEvent,function(){opts.API.prev()})}});$(document).on("cycle-update-view",function(e,opts){if(!opts.allowWrap){var cls=opts.disabledClass,next=opts.API.getComponent("next"),prev=opts.API.getComponent("prev"),prevBoundry=opts._prevBoundry||0,nextBoundry=opts._nextBoundry!==undefined?opts._nextBoundry:opts.slideCount-1;opts.currSlide==nextBoundry?next.addClass(cls).prop("disabled",!0):next.removeClass(cls).prop("disabled",!1);opts.currSlide===prevBoundry?prev.addClass(cls).prop("disabled",!0):prev.removeClass(cls).prop("disabled",!1)}});$(document).on("cycle-destroyed",function(e,opts){opts.API.getComponent("prev").off(opts.nextEvent);opts.API.getComponent("next").off(opts.prevEvent);opts.container.off("swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle")})})(jQuery); /*! progressive loader plugin for Cycle2; version: 20130315 */ (function($){"use strict";$.extend($.fn.cycle.defaults,{progressive:!1});$(document).on("cycle-pre-initialize",function(e,opts){if(opts.progressive){var API=opts.API,nextFn=API.next,prevFn=API.prev,prepareTxFn=API.prepareTx,type=$.type(opts.progressive),slides,scriptEl;if(type=="array")slides=opts.progressive;else if($.isFunction(opts.progressive))slides=opts.progressive(opts);else if(type=="string"){if(scriptEl=$(opts.progressive),slides=$.trim(scriptEl.html()),!slides)return;if(/^(\[)/.test(slides))try{slides=$.parseJSON(slides)}catch(err){API.log("error parsing progressive slides",err);return}else slides=slides.split(new RegExp(scriptEl.data("cycle-split")||"\n")),slides[slides.length-1]||slides.pop()}prepareTxFn&&(API.prepareTx=function(manual,fwd){var index,slide;if(manual||slides.length===0){prepareTxFn.apply(opts.API,[manual,fwd]);return}if(fwd&&opts.currSlide==opts.slideCount-1){slide=slides[0];slides=slides.slice(1);opts.container.one("cycle-slide-added",function(e,opts){setTimeout(function(){opts.API.advanceSlide(1)},50)});opts.API.add(slide)}else if(fwd||opts.currSlide!==0)prepareTxFn.apply(opts.API,[manual,fwd]);else{index=slides.length-1;slide=slides[index];slides=slides.slice(0,index);opts.container.one("cycle-slide-added",function(e,opts){setTimeout(function(){opts.currSlide=1;opts.API.advanceSlide(-1)},50)});opts.API.add(slide,!0)}});nextFn&&(API.next=function(){var opts=this.opts(),slide;if(slides.length&&opts.currSlide==opts.slideCount-1){slide=slides[0];slides=slides.slice(1);opts.container.one("cycle-slide-added",function(e,opts){nextFn.apply(opts.API);opts.container.removeClass("cycle-loading")});opts.container.addClass("cycle-loading");opts.API.add(slide)}else nextFn.apply(opts.API)});prevFn&&(API.prev=function(){var opts=this.opts(),index,slide;if(slides.length&&opts.currSlide===0){index=slides.length-1;slide=slides[index];slides=slides.slice(0,index);opts.container.one("cycle-slide-added",function(e,opts){opts.currSlide=1;opts.API.advanceSlide(-1);opts.container.removeClass("cycle-loading")});opts.container.addClass("cycle-loading");opts.API.add(slide,!0)}else prevFn.apply(opts.API)})}})})(jQuery); /*! tmpl plugin for Cycle2; version: 20121227 */ (function($){"use strict";$.extend($.fn.cycle.defaults,{tmplRegex:"{{((.)?.*?)}}"});$.extend($.fn.cycle.API,{tmpl:function(str,opts){var regex=new RegExp(opts.tmplRegex||$.fn.cycle.defaults.tmplRegex,"g"),args=$.makeArray(arguments);return args.shift(),str.replace(regex,function(_,str){for(var j,obj,prop,names=str.split("."),i=0;i1)for(prop=obj,j=0;ji.slideCount-i.carouselVisible||(i.API.advanceSlide(e),i.API.trigger("cycle-next",[i]))})});e.fn.cycle.transitions.carousel={preInit:function(i){i.hideNonActive=!1;i.container.on("cycle-destroyed",e.proxy(this.onDestroy,i.API));i.API.stopTransition=this.stopTransition;for(var t=0;i.startingSlide>t;t++)i.container.append(i.slides[0])},postInit:function(i){var t,n,s,o,l=i.carouselVertical,r,c;if(i.carouselVisible&&i.carouselVisible>i.slideCount&&(i.carouselVisible=i.slideCount-1),r=i.carouselVisible||i.slides.length,c={display:l?"block":"inline-block",position:"static"},i.container.css({position:"relative",overflow:"hidden"}),i.slides.css(c),i._currSlide=i.currSlide,o=e('