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