(function(n){n.flexslider=function(t,i){var r=n(t),u=n.extend({},n.flexslider.defaults,i),f=u.namespace,l="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,v=l?"touchend":"click",h="vertical"===u.direction,s=u.reverse,o=0t?r.getTarget("next"):r.getTarget("prev");r.flexAnimate(i,u.pauseOnAction)});u.pausePlay&&e.pausePlay.setup();u.slideshow&&(u.pauseOnHover&&r.hover(function(){r.manualPlay||r.manualPause||r.pause()},function(){r.manualPause||r.manualPlay||r.play()}),0<\/ol>'),1':""+i+"<\/a>",r.controlNavScaffold.append("
  • "+o+"<\/li>"),i++;r.controlsContainer?n(r.controlsContainer).append(r.controlNavScaffold):r.append(r.controlNavScaffold);e.controlNav.set();e.controlNav.active();r.controlNavScaffold.delegate("a, img",v,function(t){t.preventDefault();var t=n(this),i=r.controlNav.index(t);t.hasClass(f+"active")||(r.direction=i>r.currentSlide?"next":"prev",r.flexAnimate(i,u.pauseOnAction))});l&&r.controlNavScaffold.delegate("a","click touchstart",function(n){n.preventDefault()})},setupManual:function(){r.controlNav=r.manualControls;e.controlNav.active();r.controlNav.live(v,function(t){t.preventDefault();var t=n(this),i=r.controlNav.index(t);t.hasClass(f+"active")||(r.direction=i>r.currentSlide?"next":"prev",r.flexAnimate(i,u.pauseOnAction))});l&&r.controlNav.live("click touchstart",function(n){n.preventDefault()})},set:function(){r.controlNav=n("."+f+"control-nav li "+("thumbnails"===u.controlNav?"img":"a"),r.controlsContainer?r.controlsContainer:r)},active:function(){r.controlNav.removeClass(f+"active").eq(r.animatingTo).addClass(f+"active")},update:function(t,i){1"+r.count+"<\/a><\/li>")):1===r.pagingCount?r.controlNavScaffold.find("li").remove():r.controlNav.eq(i).closest("li").remove();e.controlNav.set();1
  • '+u.prevText+'<\/a><\/li>
  • '+u.nextText+"<\/a><\/li><\/ul>");r.controlsContainer?(n(r.controlsContainer).append(t),r.directionNav=n("."+f+"direction-nav li a",r.controlsContainer)):(r.append(t),r.directionNav=n("."+f+"direction-nav li a",r));e.directionNav.update();r.directionNav.bind(v,function(t){t.preventDefault();t=n(this).hasClass(f+"next")?r.getTarget("next"):r.getTarget("prev");r.flexAnimate(t,u.pauseOnAction)});l&&r.directionNav.bind("click touchstart",function(n){n.preventDefault()})},update:function(){var n=f+"disabled";1===r.pagingCount?r.directionNav.addClass(n):u.animationLoop?r.directionNav.removeClass(n):0===r.animatingTo?r.directionNav.removeClass(n).filter("."+f+"prev").addClass(n):r.animatingTo===r.last?r.directionNav.removeClass(n).filter("."+f+"next").addClass(n):r.directionNav.removeClass(n)}},pausePlay:{setup:function(){var t=n('
    <\/a><\/div>');r.controlsContainer?(r.controlsContainer.append(t),r.pausePlay=n("."+f+"pauseplay a",r.controlsContainer)):(r.append(t),r.pausePlay=n("."+f+"pauseplay a",r));e.pausePlay.update(u.slideshow?f+"pause":f+"play");r.pausePlay.bind(v,function(t){t.preventDefault();n(this).hasClass(f+"pause")?(r.manualPause=!0,r.manualPlay=!1,r.pause()):(r.manualPause=!1,r.manualPlay=!0,r.play())});l&&r.pausePlay.bind("click touchstart",function(n){n.preventDefault()})},update:function(n){"play"===n?r.pausePlay.removeClass(f+"pause").addClass(f+"play").text(u.playText):r.pausePlay.removeClass(f+"play").addClass(f+"pause").text(u.pauseText)}},touch:function(){function y(t){n=h?f-t.touches[0].pageY:f-t.touches[0].pageX;v=h?Math.abs(n)n||r.currentSlide===r.last&&0Number(new Date)-a&&50i/2)?r.flexAnimate(h,u.pauseOnAction):c||r.flexAnimate(r.currentSlide,u.pauseOnAction,!0)}t.removeEventListener("touchend",p,!1);l=n=e=f=null}var f,e,l,i,n,a,v=!1;t.addEventListener("touchstart",function(n){r.animating?n.preventDefault():1===n.touches.length&&(r.pause(),i=h?r.h:r.w,a=Number(new Date),l=o&&s&&r.animatingTo===r.last?0:o&&s?r.limit-(r.itemW+u.itemMargin)*r.move*r.animatingTo:o&&r.currentSlide===r.last?r.limit:o?(r.itemW+u.itemMargin)*r.move*r.currentSlide:s?(r.last-r.currentSlide+r.cloneOffset)*i:(r.currentSlide+r.cloneOffset)*i,f=h?n.touches[0].pageY:n.touches[0].pageX,e=h?n.touches[0].pageX:n.touches[0].pageY,t.addEventListener("touchmove",y,!1),t.addEventListener("touchend",p,!1))},!1)},resize:function(){!r.animating&&r.is(":visible")&&(o||r.doMath(),c?e.smoothHeight():o?(r.slides.width(r.computedW),r.update(r.pagingCount),r.setProps()):h?(r.viewport.height(r.h),r.setProps(r.h,"setTotal")):(u.smoothHeight&&e.smoothHeight(),r.newSlides.width(r.computedW),r.setProps(r.computedW,"setTotal")))},smoothHeight:function(n){if(!h||c){var t=c?r:r.viewport;n?t.animate({height:r.slides.eq(r.animatingTo).height()},n):t.height(r.slides.eq(r.animatingTo).height())}},sync:function(t){var i=n(u.sync).data("flexslider"),f=r.animatingTo;switch(t){case"animate":i.flexAnimate(f,u.pauseOnAction,!1,!0);break;case"play":i.playing||i.asNav||i.play();break;case"pause":i.pause()}}};r.flexAnimate=function(t,i,v,y,p){if(a&&1===r.pagingCount&&(r.direction=r.currentItemr.w?2*u.itemMargin:u.itemMargin,t=(r.itemW+t)*r.move*r.animatingTo,t=t>r.limit&&1!==r.visible?r.limit:t):t=0===r.currentSlide&&t===r.count-1&&u.animationLoop&&"next"!==r.direction?s?(r.count+r.cloneOffset)*w:0:r.currentSlide===r.last&&0===t&&u.animationLoop&&"prev"!==r.direction?s?0:(r.count+1)*w:s?(r.count-1-t+r.cloneOffset)*w:(t+r.cloneOffset)*w;r.setProps(t,"",u.animationSpeed);r.transitions?(u.animationLoop&&r.atEnd||(r.animating=!1,r.currentSlide=r.animatingTo),r.container.unbind("webkitTransitionEnd transitionend"),r.container.bind("webkitTransitionEnd transitionend",function(){r.wrapup(w)})):r.container.animate(r.args,u.animationSpeed,u.easing,function(){r.wrapup(w)})}u.smoothHeight&&e.smoothHeight(u.animationSpeed)}};r.wrapup=function(n){c||o||(0===r.currentSlide&&r.animatingTo===r.last&&u.animationLoop?r.setProps(n,"jumpEnd"):r.currentSlide===r.last&&0===r.animatingTo&&u.animationLoop&&r.setProps(n,"jumpStart"));r.animating=!1;r.currentSlide=r.animatingTo;u.after(r)};r.animateSlides=function(){r.animating||r.flexAnimate(r.getTarget("next"))};r.pause=function(){clearInterval(r.animatedSlides);r.playing=!1;u.pausePlay&&e.pausePlay.update("play");r.syncExists&&e.sync("pause")};r.play=function(){r.animatedSlides=setInterval(r.animateSlides,u.slideshowSpeed);r.playing=!0;u.pausePlay&&e.pausePlay.update("pause");r.syncExists&&e.sync("play")};r.canAdvance=function(n,t){var i=a?r.pagingCount-1:r.last;return t?!0:a&&r.currentItem===r.count-1&&0===n&&"prev"===r.direction?!0:a&&0===r.currentItem&&n===r.pagingCount-1&&"next"!==r.direction?!1:n===r.currentSlide&&!a?!1:u.animationLoop?!0:r.atEnd&&0===r.currentSlide&&n===i&&"next"!==r.direction?!1:r.atEnd&&r.currentSlide===i&&0===n&&"next"===r.direction?!1:!0};r.getTarget=function(n){return r.direction=n,"next"===n?r.currentSlide===r.last?0:r.currentSlide+1:0===r.currentSlide?r.last:r.currentSlide-1};r.setProps=function(n,t,i){var f,e=n?n:(r.itemW+u.itemMargin)*r.move*r.animatingTo;f=-1*function(){if(o)return"setTouch"===t?n:s&&r.animatingTo===r.last?0:s?r.limit-(r.itemW+u.itemMargin)*r.move*r.animatingTo:r.animatingTo===r.last?r.limit:e;switch(t){case"setTotal":return s?(r.count-1-r.currentSlide+r.cloneOffset)*n:(r.currentSlide+r.cloneOffset)*n;case"setTouch":return n;case"jumpEnd":return s?n:r.count*n;case"jumpStart":return s?r.count*n:n;default:return n}}()+"px";r.transitions&&(f=h?"translate3d(0,"+f+",0)":"translate3d("+f+",0,0)",i=void 0!==i?i/1e3+"s":"0s",r.container.css("-"+r.pfx+"-transition-duration",i));r.args[r.prop]=f;(r.transitions||void 0===i)&&r.container.css(r.args)};r.setup=function(t){if(c)r.slides.css({width:"100%",float:"left",marginRight:"-100%",position:"relative"}),"init"===t&&(l?r.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+u.animationSpeed/1e3+"s ease",zIndex:1}).eq(r.currentSlide).css({opacity:1,zIndex:2}):r.slides.eq(r.currentSlide).fadeIn(u.animationSpeed,u.easing)),u.smoothHeight&&e.smoothHeight();else{var i,a;"init"===t&&(r.viewport=n('
    <\/div>').css({overflow:"hidden",position:"relative"}).appendTo(r).append(r.container),r.cloneCount=0,r.cloneOffset=0,s&&(a=n.makeArray(r.slides).reverse(),r.slides=n(a),r.container.empty().append(r.slides)));u.animationLoop&&!o&&(r.cloneCount=2,r.cloneOffset=1,"init"!==t&&r.container.find(".clone").remove(),r.container.append(r.slides.first().clone().addClass("clone")).prepend(r.slides.last().clone().addClass("clone")));r.newSlides=n(u.selector,r);i=s?r.count-1-r.currentSlide+r.cloneOffset:r.currentSlide+r.cloneOffset;h&&!o?(r.container.height(200*(r.count+r.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){r.newSlides.css({display:"block"});r.doMath();r.viewport.height(r.h);r.setProps(i*r.h,"init")},"init"===t?100:0)):(r.container.width(200*(r.count+r.cloneCount)+"%"),r.setProps(i*r.computedW,"init"),setTimeout(function(){r.doMath();r.newSlides.css({width:r.computedW,float:"left",display:"block"});u.smoothHeight&&e.smoothHeight()},"init"===t?100:0))}o||r.slides.removeClass(f+"active-slide").eq(r.currentSlide).addClass(f+"active-slide")};r.doMath=function(){var f=r.slides.first(),n=u.itemMargin,t=u.minItems,i=u.maxItems;r.w=r.width();r.h=f.height();r.boxPadding=f.outerWidth()-f.width();o?(r.itemT=u.itemWidth+n,r.minW=t?t*r.itemT:r.w,r.maxW=i?i*r.itemT:r.w,r.itemW=r.minW>r.w?(r.w-n*t)/t:r.maxWr.w?r.w:u.itemWidth,r.visible=Math.floor(r.w/(r.itemW+n)),r.move=0r.w?(r.itemW+2*n)*r.count-r.w-n:(r.itemW+n)*r.count-r.w-n):(r.itemW=r.w,r.pagingCount=r.count,r.last=r.count-1);r.computedW=r.itemW-r.boxPadding};r.update=function(n,t){r.doMath();o||(nr.controlNav.length?e.controlNav.update("add"):("remove"===t&&!o||r.pagingCountr.last&&(r.currentSlide-=1,r.animatingTo-=1),e.controlNav.update("remove",r.last)));u.directionNav&&e.directionNav.update()};r.addSlide=function(t,i){var f=n(t);r.count+=1;r.last=r.count-1;h&&s?void 0!==i?r.slides.eq(r.count-i).after(f):r.container.prepend(f):void 0!==i?r.slides.eq(i).before(f):r.container.append(f);r.update(i,"add");r.slides=n(u.selector+":not(.clone)",r);r.setup();u.added(r)};r.removeSlide=function(t){var i=isNaN(t)?r.slides.index(n(t)):t;r.count-=1;r.last=r.count-1;isNaN(t)?n(t,r.slides).remove():h&&s?r.slides.eq(r.last).remove():r.slides.eq(t).remove();r.doMath();r.update(i,"remove");r.slides=n(u.selector+":not(.clone)",r);r.setup();u.removed(r)};e.init()};n.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:3e3,animationSpeed:400,initDelay:0,randomize:!1,pauseOnAction:!0,pauseOnHover:!0,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:0,maxItems:0,move:0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};n.fn.flexslider=function(t){if(void 0===t&&(t={}),"object"==typeof t)return this.each(function(){var i=n(this),r=i.find(t.selector?t.selector:".slides > li");1===r.length?(r.fadeIn(400),t.start&&t.start(i)):void 0==i.data("flexslider")&&new n.flexslider(this,t)});var i=n(this).data("flexslider");switch(t){case"play":i.play();break;case"pause":i.pause();break;case"next":i.flexAnimate(i.getTarget("next"),!0);break;case"prev":case"previous":i.flexAnimate(i.getTarget("prev"),!0);break;default:"number"==typeof t&&i.flexAnimate(t,!0)}}})(jQuery)