(function(b){var a="Lite-1.0";b.fn.cycle=function(e){return this.each(function(){e=e||{};if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var i=b(this);var h=e.slideExpr?b(e.slideExpr,this):i.children();var k=h.get();if(k.length<2){if(window.console&&window.console.log){window.console.log("terminating; too few slides: "+k.length)}return}var j=b.extend({},b.fn.cycle.defaults,e||{},b.metadata?i.metadata():b.meta?i.data():{});j.before=j.before?[j.before]:[];j.after=j.after?[j.after]:[];j.after.unshift(function(){j.busy=0});var l=this.className;j.width=parseInt((l.match(/w:(\d+)/)||[])[1])||j.width;j.height=parseInt((l.match(/h:(\d+)/)||[])[1])||j.height;j.timeout=parseInt((l.match(/t:(\d+)/)||[])[1])||j.timeout;if(i.css("position")=="static"){i.css("position","relative")}if(j.width){i.width(j.width)}if(j.height&&j.height!="auto"){i.height(j.height)}var g=0;h.css({position:"absolute",top:0,left:0}).hide().each(function(m){b(this).css("z-index",k.length-m)});b(k[g]).css("opacity",1).show();if(b.browser.msie){k[g].style.removeAttribute("filter")}if(j.fit&&j.width){h.width(j.width)}if(j.fit&&j.height&&j.height!="auto"){h.height(j.height)}if(j.pause){i.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}b.fn.cycle.transitions.fade(i,h,j);h.each(function(){var m=b(this);this.cycleH=(j.fit&&j.height)?j.height:m.height();this.cycleW=(j.fit&&j.width)?j.width:m.width()});h.not(":eq("+g+")").css({opacity:0});if(j.cssFirst){b(h[g]).css(j.cssFirst)}if(j.timeout){if(j.speed.constructor==String){j.speed={slow:600,fast:200}[j.speed]||400}if(!j.sync){j.speed=j.speed/2}while((j.timeout-j.speed)<250){j.timeout+=j.speed}}j.speedIn=j.speed;j.speedOut=j.speed;j.slideCount=k.length;j.currSlide=g;j.nextSlide=1;var f=h[g];if(j.before.length){j.before[0].apply(f,[f,f,j,true])}if(j.after.length>1){j.after[1].apply(f,[f,f,j,true])}if(j.click&&!j.next){j.next=j.click}if(j.next){b(j.next).bind("click",function(){return c(k,j,j.rev?-1:1)})}if(j.prev){b(j.prev).bind("click",function(){return c(k,j,j.rev?1:-1)})}if(j.timeout){this.cycleTimeout=setTimeout(function(){d(k,j,0,!j.rev)},j.timeout+(j.delay||0))}})};function d(h,m,i,g){if(m.busy){return}var j=h[0].parentNode,e=h[m.currSlide],f=h[m.nextSlide];if(j.cycleTimeout===0&&!i){return}if(i||!j.cyclePause){if(m.before.length){b.each(m.before,function(o,n){n.apply(f,[e,f,m,g])})}var l=function(){if(b.browser.msie){this.style.removeAttribute("filter")}b.each(m.after,function(o,n){n.apply(f,[e,f,m,g])})};if(m.nextSlide!=m.currSlide){m.busy=1;b.fn.cycle.custom(e,f,m,l)}var k=(m.nextSlide+1)==h.length;m.nextSlide=k?0:m.nextSlide+1;m.currSlide=k?h.length-1:m.nextSlide-1}if(m.timeout){j.cycleTimeout=setTimeout(function(){d(h,m,0,!m.rev)},m.timeout)}}function c(i,h,e){var f=i[0].parentNode,g=f.cycleTimeout;if(g){clearTimeout(g);f.cycleTimeout=0}h.nextSlide=h.currSlide+e;if(h.nextSlide<0){h.nextSlide=i.length-1}else{if(h.nextSlide>=i.length){h.nextSlide=0}}d(i,h,1,e>=0);return false}b.fn.cycle.custom=function(e,h,g,k){var f=b(e),i=b(h);i.css({opacity:0});var j=function(){i.animate({opacity:1},g.speedIn,g.easeIn,k)};f.animate({opacity:0},g.speedOut,g.easeOut,function(){f.css({display:"none"});if(!g.sync){j()}});if(g.sync){j()}};b.fn.cycle.transitions={fade:function(f,e,g){e.not(":eq(0)").css("opacity",0);g.before.push(function(){b(this).show()})}};b.fn.cycle.ver=function(){return a};b.fn.cycle.defaults={timeout:4000,speed:1000,next:null,prev:null,before:null,after:null,height:"auto",sync:1,fit:0,pause:0,delay:0,slideExpr:null}})(jQuery);
