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