(function(e){function j(c){e.fn.cycle.debug&&l(c)}function l(){window.console&&console.log&&console.log("[cycle] "+Array.prototype.join.call(arguments," "))}function n(c,a,d){var f=e(c).data("cycle.opts"),b=!!c.cyclePause;b&&f.paused?f.paused(c,f,a,d):!b&&f.resumed&&f.resumed(c,f,a,d)}function u(c,a,d){function f(b,c,a){if(!b&&c===!0){b=e(a).data("cycle.opts");if(!b)return l("options not found, can not resume"),!1;if(a.cycleTimeout)clearTimeout(a.cycleTimeout),a.cycleTimeout=0;o(b.elements,b,1,!b.backwards)}}
if(c.cycleStop==void 0)c.cycleStop=0;if(a===void 0||a===null)a={};if(a.constructor==String)switch(a){case "destroy":case "stop":d=e(c).data("cycle.opts");if(!d)return!1;c.cycleStop++;c.cycleTimeout&&clearTimeout(c.cycleTimeout);c.cycleTimeout=0;d.elements&&e(d.elements).stop();e(c).removeData("cycle.opts");a=="destroy"&&v(d);return!1;case "toggle":return c.cyclePause=c.cyclePause===1?0:1,f(c.cyclePause,d,c),n(c),!1;case "pause":return c.cyclePause=1,n(c),!1;case "resume":return c.cyclePause=0,f(!1,
d,c),n(c),!1;case "prev":case "next":d=e(c).data("cycle.opts");if(!d)return l('options not found, "prev/next" ignored'),!1;e.fn.cycle[a](d);return!1;default:a={fx:a}}else if(a.constructor==Number){var b=a,a=e(c).data("cycle.opts");if(!a)return l("options not found, can not advance slide"),!1;if(b<0||b>=a.elements.length)return l("invalid slide index: "+b),!1;a.nextSlide=b;if(c.cycleTimeout)clearTimeout(c.cycleTimeout),c.cycleTimeout=0;if(typeof d=="string")a.oneTimeFx=d;o(a.elements,a,1,b>=a.currSlide);
return!1}return a}function t(c,a){if(!e.support.opacity&&a.cleartype&&c.style.filter)try{c.style.removeAttribute("filter")}catch(d){}}function v(c){c.next&&e(c.next).unbind(c.prevNextEvent);c.prev&&e(c.prev).unbind(c.prevNextEvent);if(c.pager||c.pagerAnchorBuilder)e.each(c.pagerAnchors||[],function(){this.unbind().remove()});c.pagerAnchors=null;c.destroy&&c.destroy(c)}function w(c,a,d,f){var b=e.extend({},e.fn.cycle.defaults,f||{},e.metadata?c.metadata():e.meta?c.data():{});(f=e.isFunction(c.data)?
c.data(b.metaAttr):null)&&(b=e.extend(b,f));if(b.autostop)b.countdown=b.autostopCount||d.length;var h=c[0];c.data("cycle.opts",b);b.$cont=c;b.stopCount=h.cycleStop;b.elements=d;b.before=b.before?[b.before]:[];b.after=b.after?[b.after]:[];!e.support.opacity&&b.cleartype&&b.after.push(function(){t(this,b)});b.continuous&&b.after.push(function(){o(d,b,0,!b.backwards)});x(b);!e.support.opacity&&b.cleartype&&!b.cleartypeNoBg&&y(a);c.css("position")=="static"&&c.css("position","relative");b.width&&c.width(b.width);
b.height&&b.height!="auto"&&c.height(b.height);if(b.startingSlide)b.startingSlide=parseInt(b.startingSlide,10);else if(b.backwards)b.startingSlide=d.length-1;if(b.random){b.randomMap=[];for(f=0;f<d.length;f++)b.randomMap.push(f);b.randomMap.sort(function(){return Math.random()-0.5});b.randomIndex=1;b.startingSlide=b.randomMap[1]}else if(b.startingSlide>=d.length)b.startingSlide=0;b.currSlide=b.startingSlide||0;var g=b.startingSlide;a.css({position:"absolute",top:0,left:0}).hide().each(function(a){a=
b.backwards?g?a<=g?d.length+(a-g):g-a:d.length-a:g?a>=g?d.length-(a-g):g-a:d.length-a;e(this).css("z-index",a)});e(d[g]).css("opacity",1).show();t(d[g],b);b.fit&&(b.aspect?a.each(function(){var a=e(this),c=b.aspect===!0?a.width()/a.height():b.aspect;b.width&&a.width()!=b.width&&(a.width(b.width),a.height(b.width/c));b.height&&a.height()<b.height&&(a.height(b.height),a.width(b.height*c))}):(b.width&&a.width(b.width),b.height&&b.height!="auto"&&a.height(b.height)));b.center&&(!b.fit||b.aspect)&&a.each(function(){var a=
e(this);a.css({"margin-left":b.width?(b.width-a.width())/2+"px":0,"margin-top":b.height?(b.height-a.height())/2+"px":0})});b.center&&!b.fit&&!b.slideResize&&a.each(function(){var a=e(this);a.css({"margin-left":b.width?(b.width-a.width())/2+"px":0,"margin-top":b.height?(b.height-a.height())/2+"px":0})});if(b.containerResize&&!c.innerHeight()){for(var i=f=0,k=0;k<d.length;k++){var m=e(d[k]),q=m[0],r=m.outerWidth(),j=m.outerHeight();r||(r=q.offsetWidth||q.width||m.attr("width"));j||(j=q.offsetHeight||
q.height||m.attr("height"));f=r>f?r:f;i=j>i?j:i}f>0&&i>0&&c.css({width:f+"px",height:i+"px"})}var p=!1;b.pause&&c.hover(function(){p=!0;this.cyclePause++;n(h,!0)},function(){p&&this.cyclePause--;n(h,!0)});b.cssBefore=b.cssBefore||{};b.cssAfter=b.cssAfter||{};b.cssFirst=b.cssFirst||{};b.animIn=b.animIn||{};b.animOut=b.animOut||{};a.not(":eq("+g+")").css(b.cssBefore);e(a[g]).css(b.cssFirst);if(b.timeout){b.timeout=parseInt(b.timeout,10);if(b.speed.constructor==String)b.speed=e.fx.speeds[b.speed]||parseInt(b.speed,
10);b.sync||(b.speed/=2);for(f=b.fx=="none"?0:b.fx=="shuffle"?500:250;b.timeout-b.speed<f;)b.timeout+=b.speed}if(b.easing)b.easeIn=b.easeOut=b.easing;if(!b.speedIn)b.speedIn=b.speed;if(!b.speedOut)b.speedOut=b.speed;b.slideCount=d.length;b.currSlide=b.lastSlide=g;if(b.random){if(++b.randomIndex==d.length)b.randomIndex=0;b.nextSlide=b.randomMap[b.randomIndex]}else b.nextSlide=b.backwards?b.startingSlide==0?d.length-1:b.startingSlide-1:b.startingSlide>=d.length-1?0:b.startingSlide+1;if(!b.multiFx)if(f=
e.fn.cycle.transitions[b.fx],e.isFunction(f))f(c,a,b);else if(b.fx!="custom"&&!b.multiFx)return l("unknown transition: "+b.fx,"; slideshow terminating"),!1;c=a[g];b.skipInitializationCallbacks||(b.before.length&&b.before[0].apply(c,[c,c,b,!0]),b.after.length&&b.after[0].apply(c,[c,c,b,!0]));b.next&&e(b.next).bind(b.prevNextEvent,function(){return s(b,1)});b.prev&&e(b.prev).bind(b.prevNextEvent,function(){return s(b,0)});(b.pager||b.pagerAnchorBuilder)&&z(d,b);b.updateActivePagerLink(b.pager,b.startingSlide,
b.activePagerClass);return b}function x(c){c.original={before:[],after:[]};c.original.cssBefore=e.extend({},c.cssBefore);c.original.cssAfter=e.extend({},c.cssAfter);c.original.animIn=e.extend({},c.animIn);c.original.animOut=e.extend({},c.animOut);e.each(c.before,function(){c.original.before.push(this)});e.each(c.after,function(){c.original.after.push(this)})}function o(c,a,d,f){if(d&&a.busy&&a.manualTrump)j("manualTrump in go(), stopping active transition"),e(c).stop(!0,!0),a.busy=0;if(a.busy)j("transition active, ignoring new tx request");
else{var b=a.$cont[0],h=c[a.currSlide],g=c[a.nextSlide];if(!(b.cycleStop!=a.stopCount||b.cycleTimeout===0&&!d))if(!d&&!b.cyclePause&&!a.bounce&&(a.autostop&&--a.countdown<=0||a.nowrap&&!a.random&&a.nextSlide<a.currSlide))a.end&&a.end(a);else{var i=!1;if((d||!b.cyclePause)&&a.nextSlide!=a.currSlide){var i=!0,k=a.fx;h.cycleH=h.cycleH||e(h).height();h.cycleW=h.cycleW||e(h).width();g.cycleH=g.cycleH||e(g).height();g.cycleW=g.cycleW||e(g).width();if(a.multiFx){if(f&&(a.lastFx==void 0||++a.lastFx>=a.fxs.length))a.lastFx=
0;else if(!f&&(a.lastFx==void 0||--a.lastFx<0))a.lastFx=a.fxs.length-1;k=a.fxs[a.lastFx]}if(a.oneTimeFx)k=a.oneTimeFx,a.oneTimeFx=null;e.fn.cycle.resetState(a,k);a.before.length&&e.each(a.before,function(c,d){b.cycleStop==a.stopCount&&d.apply(g,[h,g,a,f])});var m=function(){a.busy=0;e.each(a.after,function(c,d){b.cycleStop==a.stopCount&&d.apply(g,[h,g,a,f])})};j("tx firing("+k+"); currSlide: "+a.currSlide+"; nextSlide: "+a.nextSlide);a.busy=1;if(a.fxFn)a.fxFn(h,g,a,m,f,d&&a.fastOnEvent);else if(e.isFunction(e.fn.cycle[a.fx]))e.fn.cycle[a.fx](h,
g,a,m,f,d&&a.fastOnEvent);else e.fn.cycle.custom(h,g,a,m,f,d&&a.fastOnEvent)}if(i||a.nextSlide==a.currSlide)if(a.lastSlide=a.currSlide,a.random){a.currSlide=a.nextSlide;if(++a.randomIndex==c.length)a.randomIndex=0;a.nextSlide=a.randomMap[a.randomIndex];if(a.nextSlide==a.currSlide)a.nextSlide=a.currSlide==a.slideCount-1?0:a.currSlide+1}else a.backwards?(d=a.nextSlide-1<0)&&a.bounce?(a.backwards=!a.backwards,a.nextSlide=1,a.currSlide=0):(a.nextSlide=d?c.length-1:a.nextSlide-1,a.currSlide=d?0:a.nextSlide+
1):(d=a.nextSlide+1==c.length)&&a.bounce?(a.backwards=!a.backwards,a.nextSlide=c.length-2,a.currSlide=c.length-1):(a.nextSlide=d?0:a.nextSlide+1,a.currSlide=d?c.length-1:a.nextSlide-1);i&&a.updateActivePagerLink(a.pager,a.currSlide,a.activePagerClass);i=0;a.timeout&&!a.continuous?i=p(c[a.currSlide],c[a.nextSlide],a,f):a.continuous&&b.cyclePause&&(i=10);if(i>0)b.cycleTimeout=setTimeout(function(){o(c,a,0,!a.backwards)},i)}}}function p(c,a,d,e){if(d.timeoutFn){for(c=d.timeoutFn.call(c,c,a,d,e);d.fx!=
"none"&&c-d.speed<250;)c+=d.speed;j("calculated timeout: "+c+"; speed: "+d.speed);if(c!==!1)return c}return d.timeout}function s(c,a){var d=a?1:-1,f=c.elements,b=c.$cont[0],h=b.cycleTimeout;if(h)clearTimeout(h),b.cycleTimeout=0;if(c.random&&d<0){c.randomIndex--;if(--c.randomIndex==-2)c.randomIndex=f.length-2;else if(c.randomIndex==-1)c.randomIndex=f.length-1;c.nextSlide=c.randomMap[c.randomIndex]}else if(c.random)c.nextSlide=c.randomMap[c.randomIndex];else if(c.nextSlide=c.currSlide+d,c.nextSlide<
0){if(c.nowrap)return!1;c.nextSlide=f.length-1}else if(c.nextSlide>=f.length){if(c.nowrap)return!1;c.nextSlide=0}b=c.onPrevNextEvent||c.prevNextClick;e.isFunction(b)&&b(d>0,c.nextSlide,f[c.nextSlide]);o(f,c,1,a);return!1}function z(c,a){var d=e(a.pager);e.each(c,function(f,b){e.fn.cycle.createPagerAnchor(f,b,d,c,a)});a.updateActivePagerLink(a.pager,a.startingSlide,a.activePagerClass)}function y(c){function a(a){a=parseInt(a,10).toString(16);return a.length<2?"0"+a:a}function d(c){for(;c&&c.nodeName.toLowerCase()!=
"html";c=c.parentNode){var b=e.css(c,"background-color");if(b&&b.indexOf("rgb")>=0)return c=b.match(/\d+/g),"#"+a(c[0])+a(c[1])+a(c[2]);if(b&&b!="transparent")return b}return"#ffffff"}j("applying clearType background-color hack");c.each(function(){e(this).css("background-color",d(this))})}if(e.support==void 0)e.support={opacity:!e.browser.msie};e.expr[":"].paused=function(c){return c.cyclePause};e.fn.cycle=function(c,a){var d={s:this.selector,c:this.context};if(this.length===0&&c!="stop"){if(!e.isReady&&
d.s)return l("DOM not ready, queuing slideshow"),e(function(){e(d.s,d.c).cycle(c,a)}),this;l("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var f=u(this,c,a);if(f!==!1){f.updateActivePagerLink=f.updateActivePagerLink||e.fn.cycle.updateActivePagerLink;this.cycleTimeout&&clearTimeout(this.cycleTimeout);this.cycleTimeout=this.cyclePause=0;var b=e(this),h=f.slideExpr?e(f.slideExpr,this):b.children(),g=h.get(),i=w(b,h,g,f,d);if(i!==
!1)if(g.length<2)l("terminating; too few slides: "+g.length);else if(b=i.continuous?10:p(g[i.currSlide],g[i.nextSlide],i,!i.backwards))b+=i.delay||0,b<10&&(b=10),j("first timeout: "+b),this.cycleTimeout=setTimeout(function(){o(g,i,0,!f.backwards)},b)}})};e.fn.cycle.resetState=function(c,a){a=a||c.fx;c.before=[];c.after=[];c.cssBefore=e.extend({},c.original.cssBefore);c.cssAfter=e.extend({},c.original.cssAfter);c.animIn=e.extend({},c.original.animIn);c.animOut=e.extend({},c.original.animOut);c.fxFn=
null;e.each(c.original.before,function(){c.before.push(this)});e.each(c.original.after,function(){c.after.push(this)});var d=e.fn.cycle.transitions[a];e.isFunction(d)&&d(c.$cont,e(c.elements),c)};e.fn.cycle.updateActivePagerLink=function(c,a,d){e(c).each(function(){e(this).children().removeClass(d).eq(a).addClass(d)})};e.fn.cycle.next=function(c){s(c,1)};e.fn.cycle.prev=function(c){s(c,0)};e.fn.cycle.createPagerAnchor=function(c,a,d,f,b){e.isFunction(b.pagerAnchorBuilder)?(a=b.pagerAnchorBuilder(c,
a),j("pagerAnchorBuilder("+c+", el) returned: "+a)):a='<a href="#">'+(c+1)+"</a>";if(a){var h=e(a);if(h.parents("body").length===0){var g=[];d.length>1?(d.each(function(){var b=h.clone(!0);e(this).append(b);g.push(b[0])}),h=e(g)):h.appendTo(d)}b.pagerAnchors=b.pagerAnchors||[];b.pagerAnchors.push(h);h.bind(b.pagerEvent,function(a){a.preventDefault();b.nextSlide=c;var a=b.$cont[0],d=a.cycleTimeout;if(d)clearTimeout(d),a.cycleTimeout=0;a=b.onPagerEvent||b.pagerClick;e.isFunction(a)&&a(b.nextSlide,f[b.nextSlide]);
o(f,b,1,b.currSlide<c)});!/^click/.test(b.pagerEvent)&&!b.allowPagerClickBubble&&h.bind("click.cycle",function(){return!1});var i=b.$cont[0],k=!1;b.pauseOnPagerHover&&h.hover(function(){k=!0;i.cyclePause++;n(i,!0,!0)},function(){k&&i.cyclePause--;n(i,!0,!0)})}};e.fn.cycle.hopsFromLast=function(c,a){var d=c.lastSlide,e=c.currSlide;return a?e>d?e-d:c.slideCount-d:e<d?d-e:d+c.slideCount-e};e.fn.cycle.commonReset=function(c,a,d,f,b,h){e(d.elements).not(c).hide();if(typeof d.cssBefore.opacity=="undefined")d.cssBefore.opacity=
1;d.cssBefore.display="block";if(d.slideResize&&f!==!1&&a.cycleW>0)d.cssBefore.width=a.cycleW;if(d.slideResize&&b!==!1&&a.cycleH>0)d.cssBefore.height=a.cycleH;d.cssAfter=d.cssAfter||{};d.cssAfter.display="none";e(c).css("zIndex",d.slideCount+(h===!0?1:0));e(a).css("zIndex",d.slideCount+(h===!0?0:1))};e.fn.cycle.custom=function(c,a,d,f,b,h){var g=e(c),i=e(a),k=d.speedIn,c=d.speedOut,j=d.easeIn,a=d.easeOut;i.css(d.cssBefore);h&&(k=typeof h=="number"?c=h:c=1,j=a=null);var l=function(){i.animate(d.animIn,
k,j,function(){f()})};g.animate(d.animOut,c,a,function(){g.css(d.cssAfter);d.sync||l()});d.sync&&l()};e.fn.cycle.transitions={fade:function(c,a,d){a.not(":eq("+d.currSlide+")").css("opacity",0);d.before.push(function(a,b,c){e.fn.cycle.commonReset(a,b,c);c.cssBefore.opacity=0});d.animIn={opacity:1};d.animOut={opacity:0};d.cssBefore={top:0,left:0}}};e.fn.cycle.ver=function(){return"2.9994"};e.fn.cycle.defaults={activePagerClass:"activeSlide",after:null,allowPagerClickBubble:!1,animIn:null,animOut:null,
aspect:!1,autostop:0,autostopCount:0,backwards:!1,before:null,center:null,cleartype:!e.support.opacity,cleartypeNoBg:!1,containerResize:1,continuous:0,cssAfter:null,cssBefore:null,delay:0,easeIn:null,easeOut:null,easing:null,end:null,fastOnEvent:0,fit:0,fx:"fade",fxFn:null,height:"auto",manualTrump:!0,metaAttr:"cycle",next:null,nowrap:0,onPagerEvent:null,onPrevNextEvent:null,pager:null,pagerAnchorBuilder:null,pagerEvent:"click.cycle",pause:0,pauseOnPagerHover:0,prev:null,prevNextEvent:"click.cycle",
random:0,randomizeEffects:1,rev:0,shuffle:null,skipInitializationCallbacks:!1,slideExpr:null,slideResize:1,speed:1E3,speedIn:null,speedOut:null,startingSlide:0,sync:1,timeout:4E3,timeoutFn:null,updateActivePagerLink:null,width:null}})(jQuery);
