/* * jquery flexslider v2.2.2 * copyright 2012 woothemes * contributing author: tyler smith */ !function(a){a.flexslider=function(b,c){var d=a(b);d.vars=a.extend({},a.flexslider.defaults,c);var j,e=d.vars.namespace,f=window.navigator&&window.navigator.mspointerenabled&&window.msgesture,g=("ontouchstart"in window||f||window.documenttouch&&document instanceof documenttouch)&&d.vars.touch,h="click touchend mspointerup",i="",k="vertical"===d.vars.direction,l=d.vars.reverse,m=d.vars.itemwidth>0,n="fade"===d.vars.animation,o=""!==d.vars.asnavfor,p={},q=!0;a.data(b,"flexslider",d),p={init:function(){d.animating=!1,d.currentslide=parseint(d.vars.startat?d.vars.startat:0,10),isnan(d.currentslide)&&(d.currentslide=0),d.animatingto=d.currentslide,d.atend=0===d.currentslide||d.currentslide===d.last,d.containerselector=d.vars.selector.substr(0,d.vars.selector.search(" ")),d.slides=a(d.vars.selector,d),d.container=a(d.containerselector,d),d.count=d.slides.length,d.syncexists=a(d.vars.sync).length>0,"slide"===d.vars.animation&&(d.vars.animation="swing"),d.prop=k?"top":"marginleft",d.args={},d.manualpause=!1,d.stopped=!1,d.started=!1,d.starttimeout=null,d.transitions=!d.vars.video&&!n&&d.vars.usecss&&function(){var a=document.createelement("div"),b=["perspectiveproperty","webkitperspective","mozperspective","operspective","msperspective"];for(var c in b)if(void 0!==a.style[b[c]])return d.pfx=b[c].replace("perspective","").tolowercase(),d.prop="-"+d.pfx+"-transform",!0;return!1}(),d.ensureanimationend="",""!==d.vars.controlscontainer&&(d.controlscontainer=a(d.vars.controlscontainer).length>0&&a(d.vars.controlscontainer)),""!==d.vars.manualcontrols&&(d.manualcontrols=a(d.vars.manualcontrols).length>0&&a(d.vars.manualcontrols)),d.vars.randomize&&(d.slides.sort(function(){return math.round(math.random())-.5}),d.container.empty().append(d.slides)),d.domath(),d.setup("init"),d.vars.controlnav&&p.controlnav.setup(),d.vars.directionnav&&p.directionnav.setup(),d.vars.keyboard&&(1===a(d.containerselector).length||d.vars.multiplekeyboard)&&a(document).bind("keyup",function(a){var b=a.keycode;if(!d.animating&&(39===b||37===b)){var c=39===b?d.gettarget("next"):37===b?d.gettarget("prev"):!1;d.flexanimate(c,d.vars.pauseonaction)}}),d.vars.mousewheel&&d.bind("mousewheel",function(a,b){a.preventdefault();var f=0>b?d.gettarget("next"):d.gettarget("prev");d.flexanimate(f,d.vars.pauseonaction)}),d.vars.pauseplay&&p.pauseplay.setup(),d.vars.slideshow&&d.vars.pauseinvisible&&p.pauseinvisible.init(),d.vars.slideshow&&(d.vars.pauseonhover&&d.hover(function(){d.manualplay||d.manualpause||d.pause()},function(){d.manualpause||d.manualplay||d.stopped||d.play()}),d.vars.pauseinvisible&&p.pauseinvisible.ishidden()||(d.vars.initdelay>0?d.starttimeout=settimeout(d.play,d.vars.initdelay):d.play())),o&&p.asnav.setup(),g&&d.vars.touch&&p.touch(),(!n||n&&d.vars.smoothheight)&&a(window).bind("resize orientationchange focus",p.resize),d.find("img").attr("draggable","false"),settimeout(function(){d.vars.start(d)},200)},asnav:{setup:function(){d.asnav=!0,d.animatingto=math.floor(d.currentslide/d.move),d.currentitem=d.currentslide,d.slides.removeclass(e+"active-slide").eq(d.currentitem).addclass(e+"active-slide"),f?(b._slider=d,d.slides.each(function(){var b=this;b._gesture=new msgesture,b._gesture.target=b,b.addeventlistener("mspointerdown",function(a){a.preventdefault(),a.currenttarget._gesture&&a.currenttarget._gesture.addpointer(a.pointerid)},!1),b.addeventlistener("msgesturetap",function(b){b.preventdefault();var c=a(this),e=c.index();a(d.vars.asnavfor).data("flexslider").animating||c.hasclass("active")||(d.direction=d.currentitem=g&&c.hasclass(e+"active-slide")?d.flexanimate(d.gettarget("prev"),!0):a(d.vars.asnavfor).data("flexslider").animating||c.hasclass(e+"active-slide")||(d.direction=d.currentitem'),d.pagingcount>1)for(var j=0;j':""+c+"","thumbnails"===d.vars.controlnav&&!0===d.vars.thumbcaptions){var k=g.attr("data-thumbcaption");""!=k&&void 0!=k&&(f+=''+k+"")}d.controlnavscaffold.append("
  • "+f+"
  • "),c++}d.controlscontainer?a(d.controlscontainer).append(d.controlnavscaffold):d.append(d.controlnavscaffold),p.controlnav.set(),p.controlnav.active(),d.controlnavscaffold.delegate("a, img",h,function(b){if(b.preventdefault(),""===i||i===b.type){var c=a(this),f=d.controlnav.index(c);c.hasclass(e+"active")||(d.direction=f>d.currentslide?"next":"prev",d.flexanimate(f,d.vars.pauseonaction))}""===i&&(i=b.type),p.settoclearwatchedevent()})},setupmanual:function(){d.controlnav=d.manualcontrols,p.controlnav.active(),d.controlnav.bind(h,function(b){if(b.preventdefault(),""===i||i===b.type){var c=a(this),f=d.controlnav.index(c);c.hasclass(e+"active")||(d.direction=f>d.currentslide?"next":"prev",d.flexanimate(f,d.vars.pauseonaction))}""===i&&(i=b.type),p.settoclearwatchedevent()})},set:function(){var b="thumbnails"===d.vars.controlnav?"img":"a";d.controlnav=a("."+e+"control-nav li "+b,d.controlscontainer?d.controlscontainer:d)},active:function(){d.controlnav.removeclass(e+"active").eq(d.animatingto).addclass(e+"active")},update:function(b,c){d.pagingcount>1&&"add"===b?d.controlnavscaffold.append(a("
  • "+d.count+"
  • ")):1===d.pagingcount?d.controlnavscaffold.find("li").remove():d.controlnav.eq(c).closest("li").remove(),p.controlnav.set(),d.pagingcount>1&&d.pagingcount!==d.controlnav.length?d.update(c,b):p.controlnav.active()}},directionnav:{setup:function(){var b=a('");d.controlscontainer?(a(d.controlscontainer).append(b),d.directionnav=a("."+e+"direction-nav li a",d.controlscontainer)):(d.append(b),d.directionnav=a("."+e+"direction-nav li a",d)),p.directionnav.update(),d.directionnav.bind(h,function(b){b.preventdefault();var c;(""===i||i===b.type)&&(c=a(this).hasclass(e+"next")?d.gettarget("next"):d.gettarget("prev"),d.flexanimate(c,d.vars.pauseonaction)),""===i&&(i=b.type),p.settoclearwatchedevent()})},update:function(){var a=e+"disabled";1===d.pagingcount?d.directionnav.addclass(a).attr("tabindex","-1"):d.vars.animationloop?d.directionnav.removeclass(a).removeattr("tabindex"):0===d.animatingto?d.directionnav.removeclass(a).filter("."+e+"prev").addclass(a).attr("tabindex","-1"):d.animatingto===d.last?d.directionnav.removeclass(a).filter("."+e+"next").addclass(a).attr("tabindex","-1"):d.directionnav.removeclass(a).removeattr("tabindex")}},pauseplay:{setup:function(){var b=a('
    ');d.controlscontainer?(d.controlscontainer.append(b),d.pauseplay=a("."+e+"pauseplay a",d.controlscontainer)):(d.append(b),d.pauseplay=a("."+e+"pauseplay a",d)),p.pauseplay.update(d.vars.slideshow?e+"pause":e+"play"),d.pauseplay.bind(h,function(b){b.preventdefault(),(""===i||i===b.type)&&(a(this).hasclass(e+"pause")?(d.manualpause=!0,d.manualplay=!1,d.pause()):(d.manualpause=!1,d.manualplay=!0,d.play())),""===i&&(i=b.type),p.settoclearwatchedevent()})},update:function(a){"play"===a?d.pauseplay.removeclass(e+"pause").addclass(e+"play").html(d.vars.playtext):d.pauseplay.removeclass(e+"play").addclass(e+"pause").html(d.vars.pausetext)}},touch:function(){function r(f){d.animating?f.preventdefault():(window.navigator.mspointerenabled||1===f.touches.length)&&(d.pause(),g=k?d.h:d.w,i=number(new date),o=f.touches[0].pagex,p=f.touches[0].pagey,e=m&&l&&d.animatingto===d.last?0:m&&l?d.limit-(d.itemw+d.vars.itemmargin)*d.move*d.animatingto:m&&d.currentslide===d.last?d.limit:m?(d.itemw+d.vars.itemmargin)*d.move*d.currentslide:l?(d.last-d.currentslide+d.cloneoffset)*g:(d.currentslide+d.cloneoffset)*g,a=k?p:o,c=k?o:p,b.addeventlistener("touchmove",s,!1),b.addeventlistener("touchend",t,!1))}function s(b){o=b.touches[0].pagex,p=b.touches[0].pagey,h=k?a-p:a-o,j=k?math.abs(h)f)&&(b.preventdefault(),!n&&d.transitions&&(d.vars.animationloop||(h/=0===d.currentslide&&0>h||d.currentslide===d.last&&h>0?math.abs(h)/g+2:1),d.setprops(e+h,"settouch")))}function t(){if(b.removeeventlistener("touchmove",s,!1),d.animatingto===d.currentslide&&!j&&null!==h){var k=l?-h:h,m=k>0?d.gettarget("next"):d.gettarget("prev");d.canadvance(m)&&(number(new date)-i<550&&math.abs(k)>50||math.abs(k)>g/2)?d.flexanimate(m,d.vars.pauseonaction):n||d.flexanimate(d.currentslide,d.vars.pauseonaction,!0)}b.removeeventlistener("touchend",t,!1),a=null,c=null,h=null,e=null}function u(a){a.stoppropagation(),d.animating?a.preventdefault():(d.pause(),b._gesture.addpointer(a.pointerid),q=0,g=k?d.h:d.w,i=number(new date),e=m&&l&&d.animatingto===d.last?0:m&&l?d.limit-(d.itemw+d.vars.itemmargin)*d.move*d.animatingto:m&&d.currentslide===d.last?d.limit:m?(d.itemw+d.vars.itemmargin)*d.move*d.currentslide:l?(d.last-d.currentslide+d.cloneoffset)*g:(d.currentslide+d.cloneoffset)*g)}function v(a){a.stoppropagation();var c=a.target._slider;if(c){var d=-a.translationx,f=-a.translationy;return q+=k?f:d,h=q,j=k?math.abs(q)500)&&(a.preventdefault(),!n&&c.transitions&&(c.vars.animationloop||(h=q/(0===c.currentslide&&0>q||c.currentslide===c.last&&q>0?math.abs(q)/g+2:1)),c.setprops(e+h,"settouch"))),void 0)}}function w(b){b.stoppropagation();var d=b.target._slider;if(d){if(d.animatingto===d.currentslide&&!j&&null!==h){var f=l?-h:h,k=f>0?d.gettarget("next"):d.gettarget("prev");d.canadvance(k)&&(number(new date)-i<550&&math.abs(f)>50||math.abs(f)>g/2)?d.flexanimate(k,d.vars.pauseonaction):n||d.flexanimate(d.currentslide,d.vars.pauseonaction,!0)}a=null,c=null,h=null,e=null,q=0}}var a,c,e,g,h,i,j=!1,o=0,p=0,q=0;f?(b.style.mstouchaction="none",b._gesture=new msgesture,b._gesture.target=b,b.addeventlistener("mspointerdown",u,!1),b._slider=d,b.addeventlistener("msgesturechange",v,!1),b.addeventlistener("msgestureend",w,!1)):b.addeventlistener("touchstart",r,!1)},resize:function(){!d.animating&&d.is(":visible")&&(m||d.domath(),n?p.smoothheight():m?(d.slides.width(d.computedw),d.update(d.pagingcount),d.setprops()):k?(d.viewport.height(d.h),d.setprops(d.h,"settotal")):(d.vars.smoothheight&&p.smoothheight(),d.newslides.width(d.computedw),d.setprops(d.computedw,"settotal")))},smoothheight:function(a){if(!k||n){var b=n?d:d.viewport;a?b.animate({height:d.slides.eq(d.animatingto).height()},a):b.height(d.slides.eq(d.animatingto).height())}},sync:function(b){var c=a(d.vars.sync).data("flexslider"),e=d.animatingto;switch(b){case"animate":c.flexanimate(e,d.vars.pauseonaction,!1,!0);break;case"play":c.playing||c.asnav||c.play();break;case"pause":c.pause()}},uniqueid:function(b){return b.find("[id]").each(function(){var b=a(this);b.attr("id",b.attr("id")+"_clone")}),b},pauseinvisible:{visprop:null,init:function(){var a=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var b=0;b0?settimeout(d.play,d.vars.initdelay):d.play()})}},ishidden:function(){return document[p.pauseinvisible.visprop]||!1}},settoclearwatchedevent:function(){cleartimeout(j),j=settimeout(function(){i=""},3e3)}},d.flexanimate=function(b,c,f,h,i){if(d.vars.animationloop||b===d.currentslide||(d.direction=b>d.currentslide?"next":"prev"),o&&1===d.pagingcount&&(d.direction=d.currentitemd.limit&&1!==d.visible?d.limit:t):s=0===d.currentslide&&b===d.count-1&&d.vars.animationloop&&"next"!==d.direction?l?(d.count+d.cloneoffset)*q:0:d.currentslide===d.last&&0===b&&d.vars.animationloop&&"prev"!==d.direction?l?0:(d.count+1)*q:l?(d.count-1-b+d.cloneoffset)*q:(b+d.cloneoffset)*q,d.setprops(s,"",d.vars.animationspeed),d.transitions?(d.vars.animationloop&&d.atend||(d.animating=!1,d.currentslide=d.animatingto),d.container.unbind("webkittransitionend transitionend"),d.container.bind("webkittransitionend transitionend",function(){cleartimeout(d.ensureanimationend),d.wrapup(q)}),cleartimeout(d.ensureanimationend),d.ensureanimationend=settimeout(function(){d.wrapup(q)},d.vars.animationspeed+100)):d.container.animate(d.args,d.vars.animationspeed,d.vars.easing,function(){d.wrapup(q)})}d.vars.smoothheight&&p.smoothheight(d.vars.animationspeed)}},d.wrapup=function(a){n||m||(0===d.currentslide&&d.animatingto===d.last&&d.vars.animationloop?d.setprops(a,"jumpend"):d.currentslide===d.last&&0===d.animatingto&&d.vars.animationloop&&d.setprops(a,"jumpstart")),d.animating=!1,d.currentslide=d.animatingto,d.vars.after(d)},d.animateslides=function(){!d.animating&&q&&d.flexanimate(d.gettarget("next"))},d.pause=function(){clearinterval(d.animatedslides),d.animatedslides=null,d.playing=!1,d.vars.pauseplay&&p.pauseplay.update("play"),d.syncexists&&p.sync("pause")},d.play=function(){d.playing&&clearinterval(d.animatedslides),d.animatedslides=d.animatedslides||setinterval(d.animateslides,d.vars.slideshowspeed),d.started=d.playing=!0,d.vars.pauseplay&&p.pauseplay.update("pause"),d.syncexists&&p.sync("play")},d.stop=function(){d.pause(),d.stopped=!0},d.canadvance=function(a,b){var c=o?d.pagingcount-1:d.last;return b?!0:o&&d.currentitem===d.count-1&&0===a&&"prev"===d.direction?!0:o&&0===d.currentitem&&a===d.pagingcount-1&&"next"!==d.direction?!1:a!==d.currentslide||o?d.vars.animationloop?!0:d.atend&&0===d.currentslide&&a===c&&"next"!==d.direction?!1:d.atend&&d.currentslide===c&&0===a&&"next"===d.direction?!1:!0:!1},d.gettarget=function(a){return d.direction=a,"next"===a?d.currentslide===d.last?0:d.currentslide+1:0===d.currentslide?d.last:d.currentslide-1},d.setprops=function(a,b,c){var e=function(){var c=a?a:(d.itemw+d.vars.itemmargin)*d.move*d.animatingto,e=function(){if(m)return"settouch"===b?a:l&&d.animatingto===d.last?0:l?d.limit-(d.itemw+d.vars.itemmargin)*d.move*d.animatingto:d.animatingto===d.last?d.limit:c;switch(b){case"settotal":return l?(d.count-1-d.currentslide+d.cloneoffset)*a:(d.currentslide+d.cloneoffset)*a;case"settouch":return l?a:a;case"jumpend":return l?a:d.count*a;case"jumpstart":return l?d.count*a:a;default:return a}}();return-1*e+"px"}();d.transitions&&(e=k?"translate3d(0,"+e+",0)":"translate3d("+e+",0,0)",c=void 0!==c?c/1e3+"s":"0s",d.container.css("-"+d.pfx+"-transition-duration",c),d.container.css("transition-duration",c)),d.args[d.prop]=e,(d.transitions||void 0===c)&&d.container.css(d.args),d.container.css("transform",e)},d.setup=function(b){if(n)d.slides.css({width:"100%","float":"left",marginright:"-100%",position:"relative"}),"init"===b&&(g?d.slides.css({opacity:0,display:"block",webkittransition:"opacity "+d.vars.animationspeed/1e3+"s ease",zindex:1}).eq(d.currentslide).css({opacity:1,zindex:2}):d.slides.css({opacity:0,display:"block",zindex:1}).eq(d.currentslide).css({zindex:2}).animate({opacity:1},d.vars.animationspeed,d.vars.easing)),d.vars.smoothheight&&p.smoothheight();else{var c,f;"init"===b&&(d.viewport=a('
    ').css({overflow:"hidden",position:"relative"}).appendto(d).append(d.container),d.clonecount=0,d.cloneoffset=0,l&&(f=a.makearray(d.slides).reverse(),d.slides=a(f),d.container.empty().append(d.slides))),d.vars.animationloop&&!m&&(d.clonecount=2,d.cloneoffset=1,"init"!==b&&d.container.find(".clone").remove(),p.uniqueid(d.slides.first().clone().addclass("clone").attr("aria-hidden","true")).appendto(d.container),p.uniqueid(d.slides.last().clone().addclass("clone").attr("aria-hidden","true")).prependto(d.container)),d.newslides=a(d.vars.selector,d),c=l?d.count-1-d.currentslide+d.cloneoffset:d.currentslide+d.cloneoffset,k&&!m?(d.container.height(200*(d.count+d.clonecount)+"%").css("position","absolute").width("100%"),settimeout(function(){d.newslides.css({display:"block"}),d.domath(),d.viewport.height(d.h),d.setprops(c*d.h,"init")},"init"===b?100:0)):(d.container.width(200*(d.count+d.clonecount)+"%"),d.setprops(c*d.computedw,"init"),settimeout(function(){d.domath(),d.newslides.css({width:d.computedw,"float":"left",display:"block"}),d.vars.smoothheight&&p.smoothheight()},"init"===b?100:0))}m||d.slides.removeclass(e+"active-slide").eq(d.currentslide).addclass(e+"active-slide"),d.vars.init(d)},d.domath=function(){var a=d.slides.first(),b=d.vars.itemmargin,c=d.vars.minitems,e=d.vars.maxitems;d.w=void 0===d.viewport?d.width():d.viewport.width(),d.h=a.height(),d.boxpadding=a.outerwidth()-a.width(),m?(d.itemt=d.vars.itemwidth+b,d.minw=c?c*d.itemt:d.w,d.maxw=e?e*d.itemt-b:d.w,d.itemw=d.minw>d.w?(d.w-b*(c-1))/c:d.maxwd.w?d.w:d.vars.itemwidth,d.visible=math.floor(d.w/d.itemw),d.move=d.vars.move>0&&d.vars.moved.w?d.itemw*(d.count-1)+b*(d.count-1):(d.itemw+b)*d.count-d.w-b):(d.itemw=d.w,d.pagingcount=d.count,d.last=d.count-1),d.computedw=d.itemw-d.boxpadding},d.update=function(a,b){d.domath(),m||(ad.controlnav.length?p.controlnav.update("add"):("remove"===b&&!m||d.pagingcountd.last&&(d.currentslide-=1,d.animatingto-=1),p.controlnav.update("remove",d.last))),d.vars.directionnav&&p.directionnav.update()},d.addslide=function(b,c){var e=a(b);d.count+=1,d.last=d.count-1,k&&l?void 0!==c?d.slides.eq(d.count-c).after(e):d.container.prepend(e):void 0!==c?d.slides.eq(c).before(e):d.container.append(e),d.update(c,"add"),d.slides=a(d.vars.selector+":not(.clone)",d),d.setup(),d.vars.added(d)},d.removeslide=function(b){var c=isnan(b)?d.slides.index(a(b)):b;d.count-=1,d.last=d.count-1,isnan(b)?a(b,d.slides).remove():k&&l?d.slides.eq(d.last).remove():d.slides.eq(b).remove(),d.domath(),d.update(c,"remove"),d.slides=a(d.vars.selector+":not(.clone)",d),d.setup(),d.vars.removed(d)},p.init()},a(window).blur(function(){focused=!1}).focus(function(){focused=!0}),a.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationloop:!0,smoothheight:!1,startat:0,slideshow:!0,slideshowspeed:7e3,animationspeed:600,initdelay:0,randomize:!1,thumbcaptions:!1,pauseonaction:!0,pauseonhover:!1,pauseinvisible:!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:1,maxitems:0,move:0,allowoneslide:!0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){},init:function(){}},a.fn.flexslider=function(b){if(void 0===b&&(b={}),"object"==typeof b)return this.each(function(){var c=a(this),d=b.selector?b.selector:".slides > li",e=c.find(d);1===e.length&&b.allowoneslide===!0||0===e.length?(e.fadein(400),b.start&&b.start(c)):void 0===c.data("flexslider")&&new a.flexslider(this,b)});var c=a(this).data("flexslider");switch(b){case"play":c.play();break;case"pause":c.pause();break;case"stop":c.stop();break;case"next":c.flexanimate(c.gettarget("next"),!0);break;case"prev":case"previous":c.flexanimate(c.gettarget("prev"),!0);break;default:"number"==typeof b&&c.flexanimate(b,!0)}}}(jquery);