(function(d){var a="2.34";if(d.support==undefined){d.support={opacity:!(d.browser.msie&&/MSIE 6.0/.test(navigator.userAgent))}}function g(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments,""))}}d.fn.cycle=function(j){if(this.length==0){g("terminating; zero elements found by selector"+(d.isReady?"":" (DOM not ready)"));return this}var i=arguments[1];return this.each(function(){if(this.cycleStop==undefined){this.cycleStop=0}if(j===undefined||j===null){j={}}if(j.constructor==String){switch(j){case"stop":this.cycleStop++;if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;d(this).removeData("cycle.opts");return;case"pause":this.cyclePause=1;return;case"resume":this.cyclePause=0;if(i===true){j=d(this).data("cycle.opts");if(!j){g("options not found, can not resume");return}if(this.cycleTimeout){clearTimeout(this.cycleTimeout);this.cycleTimeout=0}f(j.elements,j,1,1)}return;default:j={fx:j}}}else{if(j.constructor==Number){var r=j;j=d(this).data("cycle.opts");if(!j){g("options not found, can not advance slide");return}if(r<0||r>=j.elements.length){g("invalid slide index: "+r);return}j.nextSlide=r;if(this.cycleTimeout){clearTimeout(this.cycleTimeout);this.cycleTimeout=0}f(j.elements,j,1,r>=j.currSlide);return}}if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var m=d(this);var q=j.slideExpr?d(j.slideExpr,this):m.children();var v=q.get();if(v.length<2){g("terminating; too few slides: "+v.length);return}var y=d.extend({},d.fn.cycle.defaults,j||{},d.metadata?m.metadata():d.meta?m.data():{});if(y.autostop){y.countdown=y.autostopCount||v.length}m.data("cycle.opts",y);y.container=this;y.stopCount=this.cycleStop;y.elements=v;y.before=y.before?[y.before]:[];y.after=y.after?[y.after]:[];y.after.unshift(function(){y.busy=0});if(y.continuous){y.after.push(function(){f(v,y,0,!y.rev)})}if(!d.support.opacity&&y.cleartype&&!y.cleartypeNoBg){h(q)}var k=this.className;y.width=parseInt((k.match(/w:(\d+)/)||[])[1])||y.width;y.height=parseInt((k.match(/h:(\d+)/)||[])[1])||y.height;y.timeout=parseInt((k.match(/t:(\d+)/)||[])[1])||y.timeout;if(m.css("position")=="static"){m.css("position","relative")}if(y.width){m.width(y.width)}if(y.height&&y.height!="auto"){m.height(y.height)}if(y.startingSlide){y.startingSlide=parseInt(y.startingSlide)}if(y.random){y.randomMap=[];for(var u=0;u<v.length;u++){y.randomMap.push(u)}y.randomMap.sort(function(A,z){return Math.random()-0.5});y.randomIndex=0;y.startingSlide=y.randomMap[0]}else{if(y.startingSlide>=v.length){y.startingSlide=0}}var s=y.startingSlide||0;q.css({position:"absolute",top:0,left:0}).hide().each(function(A){var z=s?A>=s?v.length-(A-s):s-A:v.length-A;d(this).css("z-index",z)});d(v[s]).css("opacity",1).show();if(d.browser.msie){v[s].style.removeAttribute("filter")}if(y.fit&&y.width){q.width(y.width)}if(y.fit&&y.height&&y.height!="auto"){q.height(y.height)}if(y.containerResize){var p=0,w=0;for(var u=0;u<v.length;u++){var x=d(v[u]),n=x.outerWidth(),t=x.outerHeight();p=n>p?n:p;w=t>w?t:w}m.css({width:p+"px",height:w+"px"})}if(y.pause){m.hover(function(){this.cyclePause++},function(){this.cyclePause--})}var l=d.fn.cycle.transitions[y.fx];if(d.isFunction(l)){l(m,q,y)}else{if(y.fx!="custom"){g("unknown transition: "+y.fx)}}q.each(function(){var z=d(this);this.cycleH=(y.fit&&y.height)?y.height:z.height();this.cycleW=(y.fit&&y.width)?y.width:z.width()});y.cssBefore=y.cssBefore||{};y.animIn=y.animIn||{};y.animOut=y.animOut||{};q.not(":eq("+s+")").css(y.cssBefore);if(y.cssFirst){d(q[s]).css(y.cssFirst)}if(y.timeout){y.timeout=parseInt(y.timeout);if(y.speed.constructor==String){y.speed=d.fx.speeds[y.speed]||parseInt(y.speed)}if(!y.sync){y.speed=y.speed/2}while((y.timeout-y.speed)<250){y.timeout+=y.speed}}if(y.easing){y.easeIn=y.easeOut=y.easing}if(!y.speedIn){y.speedIn=y.speed}if(!y.speedOut){y.speedOut=y.speed}y.slideCount=v.length;y.currSlide=s;if(y.random){y.nextSlide=y.currSlide;if(++y.randomIndex==v.length){y.randomIndex=0}y.nextSlide=y.randomMap[y.randomIndex]}else{y.nextSlide=y.startingSlide>=(v.length-1)?0:y.startingSlide+1}var o=q[s];if(y.before.length){y.before[0].apply(o,[o,o,y,true])}if(y.after.length>1){y.after[1].apply(o,[o,o,y,true])}if(y.click&&!y.next){y.next=y.click}if(y.next){d(y.next).bind("click",function(){return e(v,y,y.rev?-1:1)})}if(y.prev){d(y.prev).bind("click",function(){return e(v,y,y.rev?1:-1)})}if(y.pager){b(v,y)}y.addSlide=function(A,z){var B=d(A),C=B[0];if(!y.autostopCount){y.countdown++}v[z?"unshift":"push"](C);if(y.els){y.els[z?"unshift":"push"](C)}y.slideCount=v.length;B.css("position","absolute");B[z?"prependTo":"appendTo"](m);if(z){y.currSlide++;y.nextSlide++}if(!d.support.opacity&&y.cleartype&&!y.cleartypeNoBg){h(B)}if(y.fit&&y.width){B.width(y.width)}if(y.fit&&y.height&&y.height!="auto"){q.height(y.height)}C.cycleH=(y.fit&&y.height)?y.height:B.height();C.cycleW=(y.fit&&y.width)?y.width:B.width();B.css(y.cssBefore);if(y.pager){d.fn.cycle.createPagerAnchor(v.length-1,C,d(y.pager),v,y)}if(typeof y.onAddSlide=="function"){y.onAddSlide(B)}};if(y.timeout||y.continuous){this.cycleTimeout=setTimeout(function(){f(v,y,0,!y.rev)},y.continuous?10:y.timeout+(y.delay||0))}})};function f(l,q,m,k){if(q.busy){return}var n=q.container,i=l[q.currSlide],j=l[q.nextSlide];if(n.cycleStop!=q.stopCount||n.cycleTimeout===0&&!m){return}if(!m&&!n.cyclePause&&((q.autostop&&(--q.countdown<=0))||(q.nowrap&&!q.random&&q.nextSlide<q.currSlide))){if(q.end){q.end(q)}return}if(m||!n.cyclePause){if(q.before.length){d.each(q.before,function(s,r){if(n.cycleStop!=q.stopCount){return}r.apply(j,[i,j,q,k])})}var p=function(){if(d.browser.msie&&q.cleartype){this.style.removeAttribute("filter")}d.each(q.after,function(s,r){if(n.cycleStop!=q.stopCount){return}r.apply(j,[i,j,q,k])})};if(q.nextSlide!=q.currSlide){q.busy=1;if(q.fxFn){q.fxFn(i,j,q,p,k)}else{if(d.isFunction(d.fn.cycle[q.fx])){d.fn.cycle[q.fx](i,j,q,p)}else{d.fn.cycle.custom(i,j,q,p,m&&q.fastOnEvent)}}}if(q.random){q.currSlide=q.nextSlide;if(++q.randomIndex==l.length){q.randomIndex=0}q.nextSlide=q.randomMap[q.randomIndex]}else{var o=(q.nextSlide+1)==l.length;q.nextSlide=o?0:q.nextSlide+1;q.currSlide=o?l.length-1:q.nextSlide-1}if(q.pager){d.fn.cycle.updateActivePagerLink(q.pager,q.currSlide)}}if(q.timeout&&!q.continuous){n.cycleTimeout=setTimeout(function(){f(l,q,0,!q.rev)},c(i,j,q,k))}else{if(q.continuous&&n.cyclePause){n.cycleTimeout=setTimeout(function(){f(l,q,0,!q.rev)},10)}}}d.fn.cycle.updateActivePagerLink=function(j,i){d(j).find("a").removeClass("activeSlide").filter("a:eq("+i+")").addClass("activeSlide")};function c(m,j,i,k){if(i.timeoutFn){var l=i.timeoutFn(m,j,i,k);if(l!==false){return l}}return i.timeout}function e(l,k,m){var i=k.container,j=i.cycleTimeout;if(j){clearTimeout(j);i.cycleTimeout=0}if(k.random&&m<0){k.randomIndex--;if(--k.randomIndex==-2){k.randomIndex=l.length-2}else{if(k.randomIndex==-1){k.randomIndex=l.length-1}}k.nextSlide=k.randomMap[k.randomIndex]}else{if(k.random){if(++k.randomIndex==l.length){k.randomIndex=0}k.nextSlide=k.randomMap[k.randomIndex]}else{k.nextSlide=k.currSlide+m;if(k.nextSlide<0){if(k.nowrap){return false}k.nextSlide=l.length-1}else{if(k.nextSlide>=l.length){if(k.nowrap){return false}k.nextSlide=0}}}}if(k.prevNextClick&&typeof k.prevNextClick=="function"){k.prevNextClick(m>0,k.nextSlide,l[k.nextSlide])}f(l,k,1,m>=0);return false}function b(j,i){var k=d(i.pager);d.each(j,function(l,m){d.fn.cycle.createPagerAnchor(l,m,k,j,i)});d.fn.cycle.updateActivePagerLink(i.pager,i.startingSlide)}d.fn.cycle.createPagerAnchor=function(i,o,k,j,n){var l=(typeof n.pagerAnchorBuilder=="function")?n.pagerAnchorBuilder(i,o):'<a href="#">'+(i+1)+"</a>";if(!l){return}var m=d(l);if(m.parents("body").length==0){m.appendTo(k)}m.bind(n.pagerEvent,function(){n.nextSlide=i;var p=n.container,q=p.cycleTimeout;if(q){clearTimeout(q);p.cycleTimeout=0}if(typeof n.pagerClick=="function"){n.pagerClick(n.nextSlide,j[n.nextSlide])}f(j,n,1,n.currSlide<i);return false});if(n.pauseOnPagerHover){m.hover(function(){n.container.cyclePause++},function(){n.container.cyclePause--})}};function h(i){function j(l){var l=parseInt(l).toString(16);return l.length<2?"0"+l:l}function k(m){for(;m&&m.nodeName.toLowerCase()!="html";m=m.parentNode){var l=d.css(m,"background-color");if(l.indexOf("rgb")>=0){var n=l.match(/\d+/g);return"#"+j(n[0])+j(n[1])+j(n[2])}if(l&&l!="transparent"){return l}}return"#ffffff"}i.each(function(){d(this).css("background-color",k(this))})}d.fn.cycle.custom=function(i,o,t,r,s){var j=d(i),n=d(o);n.css(t.cssBefore);var q=s?1:t.speedIn;var k=s?1:t.speedOut;var p=s?null:t.easeIn;var l=s?null:t.easeOut;var m=function(){n.animate(t.animIn,q,p,r)};j.animate(t.animOut,k,l,function(){if(t.cssAfter){j.css(t.cssAfter)}if(!t.sync){m()}});if(t.sync){m()}};d.fn.cycle.transitions={fade:function(j,i,k){i.not(":eq("+k.startingSlide+")").css("opacity",0);k.before.push(function(){d(this).show()});k.animIn={opacity:1};k.animOut={opacity:0};k.cssBefore={opacity:0};k.cssAfter={display:"none"};k.onAddSlide=function(l){l.hide()}}};d.fn.cycle.ver=function(){return a};d.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:0,nowrap:0,fastOnEvent:0}})(jQuery);
