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