(function(e){function s(a){e.fn.cycle.debug&&k(a)}function k(){window.console&&window.console.log&&window.console.log("[cycle] "+Array.prototype.join.call(arguments," "))}function y(a,c,d){if(a.cycleStop==undefined)a.cycleStop=0;if(c===undefined||c===null)c={};if(c.constructor==String){switch(c){case "stop":a.cycleStop++;a.cycleTimeout&&clearTimeout(a.cycleTimeout);a.cycleTimeout=0;e(a).removeData("cycle.opts");return false;case "toggle":a.cyclePause=a.cyclePause===1?0:1;return false;case "pause":a.cyclePause= 1;return false;case "resume":a.cyclePause=0;if(d===true){c=e(a).data("cycle.opts");if(!c){k("options not found, can not resume");return false}if(a.cycleTimeout){clearTimeout(a.cycleTimeout);a.cycleTimeout=0}n(c.elements,c,1,1)}return false;case "prev":case "next":a=e(a).data("cycle.opts");if(!a){k('options not found, "prev/next" ignored');return false}e.fn.cycle[c](a);return false;default:c={fx:c}}return c}else if(c.constructor==Number){var f=c;c=e(a).data("cycle.opts");if(!c){k("options not found, can not advance slide"); return false}if(f<0||f>=c.elements.length){k("invalid slide index: "+f);return false}c.nextSlide=f;if(a.cycleTimeout){clearTimeout(a.cycleTimeout);a.cycleTimeout=0}if(typeof d=="string")c.oneTimeFx=d;n(c.elements,c,1,f>=c.currSlide);return false}return c}function t(a,c){if(!e.support.opacity&&c.cleartype&&a.style.filter)try{a.style.removeAttribute("filter")}catch(d){}}function z(a,c,d,f,g){var b=e.extend({},e.fn.cycle.defaults,f||{},e.metadata?a.metadata():e.meta?a.data():{});if(b.autostop)b.countdown= b.autostopCount||d.length;var h=a[0];a.data("cycle.opts",b);b.$cont=a;b.stopCount=h.cycleStop;b.elements=d;b.before=b.before?[b.before]:[];b.after=b.after?[b.after]:[];b.after.unshift(function(){b.busy=0});!e.support.opacity&&b.cleartype&&b.after.push(function(){t(this,b)});b.continuous&&b.after.push(function(){n(d,b,0,!b.rev)});A(b);!e.support.opacity&&b.cleartype&&!b.cleartypeNoBg&&u(c);a.css("position")=="static"&&a.css("position","relative");b.width&&a.width(b.width);b.height&&b.height!="auto"&& a.height(b.height);if(b.startingSlide)b.startingSlide=parseInt(b.startingSlide);if(b.random){b.randomMap=[];for(h=0;h<d.length;h++)b.randomMap.push(h);b.randomMap.sort(function(){return Math.random()-0.5});b.randomIndex=0;b.startingSlide=b.randomMap[0]}else if(b.startingSlide>=d.length)b.startingSlide=0;b.currSlide=b.startingSlide=b.startingSlide||0;var i=b.startingSlide;c.css({position:"absolute",top:0,left:0}).hide().each(function(l){l=i?l>=i?d.length-(l-i):i-l:d.length-l;e(this).css("z-index", l)});e(d[i]).css("opacity",1).show();t(d[i],b);b.fit&&b.width&&c.width(b.width);b.fit&&b.height&&b.height!="auto"&&c.height(b.height);if(b.containerResize&&!a.innerHeight()){for(var j=h=0,o=0;o<d.length;o++){var m=e(d[o]),v=m[0],q=m.outerWidth();m=m.outerHeight();if(!q)q=v.offsetWidth;if(!m)m=v.offsetHeight;h=q>h?q:h;j=m>j?m:j}h>0&&j>0&&a.css({width:h+"px",height:j+"px"})}b.pause&&a.hover(function(){this.cyclePause++},function(){this.cyclePause--});if(B(b)===false)return false;var w=false;f.requeueAttempts= f.requeueAttempts||0;c.each(function(){var l=e(this);this.cycleH=b.fit&&b.height?b.height:l.height();this.cycleW=b.fit&&b.width?b.width:l.width();if(l.is("img")){l=e.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete;var C=e.browser.opera&&(this.cycleW==42&&this.cycleH==19||this.cycleW==37&&this.cycleH==17)&&!this.complete,D=this.cycleH==0&&this.cycleW==0&&!this.complete;if(e.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete||l||C||D)if(g.s&&b.requeueOnImageNotLoaded&& ++f.requeueAttempts<100){k(f.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){e(g.s,g.c).cycle(f)},b.requeueTimeout);w=true;return false}else k("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}return true});if(w)return false;b.cssBefore=b.cssBefore||{};b.animIn=b.animIn||{};b.animOut=b.animOut||{};c.not(":eq("+i+")").css(b.cssBefore);b.cssFirst&&e(c[i]).css(b.cssFirst);if(b.timeout){b.timeout=parseInt(b.timeout); if(b.speed.constructor==String)b.speed=e.fx.speeds[b.speed]||parseInt(b.speed);for(b.sync||(b.speed/=2);b.timeout-b.speed<250;)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=i;if(b.random){b.nextSlide=b.currSlide;if(++b.randomIndex==d.length)b.randomIndex=0;b.nextSlide=b.randomMap[b.randomIndex]}else b.nextSlide=b.startingSlide>=d.length-1?0:b.startingSlide+1;if(!b.multiFx){h= e.fn.cycle.transitions[b.fx];if(e.isFunction(h))h(a,c,b);else if(b.fx!="custom"&&!b.multiFx){k("unknown transition: "+b.fx,"; slideshow terminating");return false}}a=c[i];b.before.length&&b.before[0].apply(a,[a,a,b,true]);b.after.length>1&&b.after[1].apply(a,[a,a,b,true]);b.next&&e(b.next).bind(b.prevNextEvent,function(){return r(b,b.rev?-1:1)});b.prev&&e(b.prev).bind(b.prevNextEvent,function(){return r(b,b.rev?1:-1)});b.pager&&E(d,b);F(b,d);return b}function A(a){a.original={before:[],after:[]}; a.original.cssBefore=e.extend({},a.cssBefore);a.original.cssAfter=e.extend({},a.cssAfter);a.original.animIn=e.extend({},a.animIn);a.original.animOut=e.extend({},a.animOut);e.each(a.before,function(){a.original.before.push(this)});e.each(a.after,function(){a.original.after.push(this)})}function B(a){var c,d,f=e.fn.cycle.transitions;if(a.fx.indexOf(",")>0){a.multiFx=true;a.fxs=a.fx.replace(/\s*/g,"").split(",");for(c=0;c<a.fxs.length;c++){var g=a.fxs[c];d=f[g];if(!d||!f.hasOwnProperty(g)||!e.isFunction(d)){k("discarding unknown transition: ", g);a.fxs.splice(c,1);c--}}if(!a.fxs.length){k("No valid transitions named; slideshow terminating.");return false}}else if(a.fx=="all"){a.multiFx=true;a.fxs=[];for(p in f){d=f[p];f.hasOwnProperty(p)&&e.isFunction(d)&&a.fxs.push(p)}}if(a.multiFx&&a.randomizeEffects){d=Math.floor(Math.random()*20)+30;for(c=0;c<d;c++)a.fxs.push(a.fxs.splice(Math.floor(Math.random()*a.fxs.length),1)[0]);s("randomized fx sequence: ",a.fxs)}return true}function F(a,c){a.addSlide=function(d,f){var g=e(d),b=g[0];a.autostopCount|| a.countdown++;c[f?"unshift":"push"](b);if(a.els)a.els[f?"unshift":"push"](b);a.slideCount=c.length;g.css("position","absolute");g[f?"prependTo":"appendTo"](a.$cont);if(f){a.currSlide++;a.nextSlide++}!e.support.opacity&&a.cleartype&&!a.cleartypeNoBg&&u(g);a.fit&&a.width&&g.width(a.width);a.fit&&a.height&&a.height!="auto"&&$slides.height(a.height);b.cycleH=a.fit&&a.height?a.height:g.height();b.cycleW=a.fit&&a.width?a.width:g.width();g.css(a.cssBefore);a.pager&&e.fn.cycle.createPagerAnchor(c.length- 1,b,e(a.pager),c,a);e.isFunction(a.onAddSlide)?a.onAddSlide(g):g.hide()}}function n(a,c,d,f){if(d&&c.busy&&c.manualTrump){e(a).stop(true,true);c.busy=false}if(!c.busy){var g=c.$cont[0],b=a[c.currSlide],h=a[c.nextSlide];if(!(g.cycleStop!=c.stopCount||g.cycleTimeout===0&&!d))if(!d&&!g.cyclePause&&(c.autostop&&--c.countdown<=0||c.nowrap&&!c.random&&c.nextSlide<c.currSlide))c.end&&c.end(c);else{if(d||!g.cyclePause){var i=c.fx;b.cycleH=b.cycleH||e(b).height();b.cycleW=b.cycleW||e(b).width();h.cycleH=h.cycleH|| e(h).height();h.cycleW=h.cycleW||e(h).width();if(c.multiFx){if(c.lastFx==undefined||++c.lastFx>=c.fxs.length)c.lastFx=0;i=c.fxs[c.lastFx];c.currFx=i}if(c.oneTimeFx){i=c.oneTimeFx;c.oneTimeFx=null}e.fn.cycle.resetState(c,i);c.before.length&&e.each(c.before,function(j,o){g.cycleStop==c.stopCount&&o.apply(h,[b,h,c,f])});i=function(){e.each(c.after,function(j,o){g.cycleStop==c.stopCount&&o.apply(h,[b,h,c,f])})};if(c.nextSlide!=c.currSlide){c.busy=1;if(c.fxFn)c.fxFn(b,h,c,i,f);else e.isFunction(e.fn.cycle[c.fx])? e.fn.cycle[c.fx](b,h,c,i):e.fn.cycle.custom(b,h,c,i,d&&c.fastOnEvent)}c.lastSlide=c.currSlide;if(c.random){c.currSlide=c.nextSlide;if(++c.randomIndex==a.length)c.randomIndex=0;c.nextSlide=c.randomMap[c.randomIndex]}else{d=c.nextSlide+1==a.length;c.nextSlide=d?0:c.nextSlide+1;c.currSlide=d?a.length-1:c.nextSlide-1}c.pager&&e.fn.cycle.updateActivePagerLink(c.pager,c.currSlide)}d=0;if(c.timeout&&!c.continuous)d=x(b,h,c,f);else if(c.continuous&&g.cyclePause)d=10;if(d>0)g.cycleTimeout=setTimeout(function(){n(a, c,0,!c.rev)},d)}}}function x(a,c,d,f){if(d.timeoutFn){for(a=d.timeoutFn(a,c,d,f);a-d.speed<250;)a+=d.speed;s("calculated timeout: "+a+"; speed: "+d.speed);if(a!==false)return a}return d.timeout}function r(a,c){var d=a.elements,f=a.$cont[0],g=f.cycleTimeout;if(g){clearTimeout(g);f.cycleTimeout=0}if(a.random&&c<0){a.randomIndex--;if(--a.randomIndex==-2)a.randomIndex=d.length-2;else if(a.randomIndex==-1)a.randomIndex=d.length-1;a.nextSlide=a.randomMap[a.randomIndex]}else if(a.random){if(++a.randomIndex== d.length)a.randomIndex=0;a.nextSlide=a.randomMap[a.randomIndex]}else{a.nextSlide=a.currSlide+c;if(a.nextSlide<0){if(a.nowrap)return false;a.nextSlide=d.length-1}else if(a.nextSlide>=d.length){if(a.nowrap)return false;a.nextSlide=0}}e.isFunction(a.prevNextClick)&&a.prevNextClick(c>0,a.nextSlide,d[a.nextSlide]);n(d,a,1,c>=0);return false}function E(a,c){var d=e(c.pager);e.each(a,function(f,g){e.fn.cycle.createPagerAnchor(f,g,d,a,c)});e.fn.cycle.updateActivePagerLink(c.pager,c.startingSlide)}function u(a){function c(f){f= parseInt(f).toString(16);return f.length<2?"0"+f:f}function d(f){for(;f&&f.nodeName.toLowerCase()!="html";f=f.parentNode){var g=e.css(f,"background-color");if(g.indexOf("rgb")>=0){f=g.match(/\d+/g);return"#"+c(f[0])+c(f[1])+c(f[2])}if(g&&g!="transparent")return g}return"#ffffff"}a.each(function(){e(this).css("background-color",d(this))})}if(e.support==undefined)e.support={opacity:!e.browser.msie};e.fn.cycle=function(a,c){var d={s:this.selector,c:this.context};if(this.length===0&&a!="stop"){if(!e.isReady&& d.s){k("DOM not ready, queuing slideshow");e(function(){e(d.s,d.c).cycle(a,c)});return this}k("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var f=y(this,a,c);if(f!==false){this.cycleTimeout&&clearTimeout(this.cycleTimeout);this.cycleTimeout=this.cyclePause=0;var g=e(this),b=f.slideExpr?e(f.slideExpr,this):g.children(),h=b.get();if(h.length<2)k("terminating; too few slides: "+h.length);else{var i=z(g,b,h,f,d);if(i!==false)if(f= i.continuous?10:x(i.currSlide,i.nextSlide,i,!i.rev)){f+=i.delay||0;if(f<10)f=10;s("first timeout: "+f);this.cycleTimeout=setTimeout(function(){n(h,i,0,!i.rev)},f)}}}})};e.fn.cycle.resetState=function(a,c){c=c||a.fx;a.before=[];a.after=[];a.cssBefore=e.extend({},a.original.cssBefore);a.cssAfter=e.extend({},a.original.cssAfter);a.animIn=e.extend({},a.original.animIn);a.animOut=e.extend({},a.original.animOut);a.fxFn=null;e.each(a.original.before,function(){a.before.push(this)});e.each(a.original.after, function(){a.after.push(this)});var d=e.fn.cycle.transitions[c];e.isFunction(d)&&d(a.$cont,e(a.elements),a)};e.fn.cycle.updateActivePagerLink=function(a,c){e(a).each(function(){e(this).find("a").removeClass("activeSlide").filter("a:eq("+c+")").addClass("activeSlide")})};e.fn.cycle.next=function(a){r(a,a.rev?-1:1)};e.fn.cycle.prev=function(a){r(a,a.rev?1:-1)};e.fn.cycle.createPagerAnchor=function(a,c,d,f,g){if(c=e.isFunction(g.pagerAnchorBuilder)?g.pagerAnchorBuilder(a,c):'<a href="#">'+(a+1)+"</a>"){var b= e(c);if(b.parents("body").length===0){var h=[];if(d.length>1){d.each(function(){var i=b.clone(true);e(this).append(i);h.push(i[0])});b=e(h)}else b.appendTo(d)}b.bind(g.pagerEvent,function(i){i.preventDefault();g.nextSlide=a;i=g.$cont[0];var j=i.cycleTimeout;if(j){clearTimeout(j);i.cycleTimeout=0}e.isFunction(g.pagerClick)&&g.pagerClick(g.nextSlide,f[g.nextSlide]);n(f,g,1,g.currSlide<a);return false});g.pagerEvent!="click"&&b.click(function(){return false});g.pauseOnPagerHover&&b.hover(function(){g.$cont[0].cyclePause++}, function(){g.$cont[0].cyclePause--})}};e.fn.cycle.hopsFromLast=function(a,c){var d=a.lastSlide,f=a.currSlide;return c?f>d?f-d:a.slideCount-d:f<d?d-f:d+a.slideCount-f};e.fn.cycle.commonReset=function(a,c,d,f,g,b){e(d.elements).not(a).hide();d.cssBefore.opacity=1;d.cssBefore.display="block";if(f!==false&&c.cycleW>0)d.cssBefore.width=c.cycleW;if(g!==false&&c.cycleH>0)d.cssBefore.height=c.cycleH;d.cssAfter=d.cssAfter||{};d.cssAfter.display="none";e(a).css("zIndex",d.slideCount+(b===true?1:0));e(c).css("zIndex", d.slideCount+(b===true?0:1))};e.fn.cycle.custom=function(a,c,d,f,g){var b=e(a),h=e(c),i=d.speedIn;a=d.speedOut;var j=d.easeIn;c=d.easeOut;h.css(d.cssBefore);if(g){i=typeof g=="number"?a=g:a=1;j=c=null}b.animate(d.animOut,a,c,function(){d.cssAfter&&b.css(d.cssAfter);d.sync||h.animate(d.animIn,i,j,f)});d.sync&&h.animate(d.animIn,i,j,f)};e.fn.cycle.transitions={fade:function(a,c,d){c.not(":eq("+d.currSlide+")").css("opacity",0);d.before.push(function(f,g,b){e.fn.cycle.commonReset(f,g,b);b.cssBefore.opacity= 0});d.animIn={opacity:1};d.animOut={opacity:0};d.cssBefore={top:0,left:0}}};e.fn.cycle.ver=function(){return"2.74"};e.fn.cycle.defaults={fx:"fade",timeout:4E3,timeoutFn:null,continuous:0,speed:1E3,speedIn:null,speedOut:null,next:null,prev:null,prevNextClick:null,prevNextEvent:"click",pager:null,pagerClick:null,pagerEvent:"click",pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null, height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!e.support.opacity,cleartypeNoBg:false,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250}})(jQuery);
