(function(d){var a="Lite-1.3";d.fn.cycle=function(e){return this.each(function(){e=e||{};if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var v=d(this);var q=e.slideExpr?d(e.slideExpr,this):v.children();var l=q.get();if(l.length<2){window.console&&console.log("terminating; too few slides: "+l.length);return}var f=d.extend({},d.fn.cycle.defaults,e||{},d.metadata?v.metadata():d.meta?v.data():{});var x=d.isFunction(v.data)?v.data(f.metaAttr):null;if(x){f=d.extend(f,x)}f.before=f.before?[f.before]:[];f.after=f.after?[f.after]:[];f.after.unshift(function(){f.busy=0});var y=this.className;f.width=parseInt((y.match(/w:(\d+)/)||[])[1])||f.width;f.height=parseInt((y.match(/h:(\d+)/)||[])[1])||f.height;f.timeout=parseInt((y.match(/t:(\d+)/)||[])[1])||f.timeout;if(v.css("position")=="static"){v.css("position","relative")}if(f.width){v.width(f.width)}if(f.height&&f.height!="auto"){v.height(f.height)}var o=0;q.css({position:"absolute",top:0,left:0}).each(function(h){d(this).css("z-index",l.length-h)});d(l[o]).css("opacity",1).show();if(d.browser.msie){l[o].style.removeAttribute("filter")}if(f.fit&&f.width){q.width(f.width)}if(f.fit&&f.height&&f.height!="auto"){q.height(f.height)}if(f.pause){v.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}var m=f.containerResize&&!v.innerHeight();if(m){var s=0,k=0;for(var i=0;i<l.length;i++){var g=d(l[i]),p=g[0],u=g.outerWidth(),n=g.outerHeight();if(!u){u=p.offsetWidth||p.width||g.attr("width")}if(!n){n=p.offsetHeight||p.height||g.attr("height")}s=u>s?u:s;k=n>k?n:k}if(s>0&&k>0){v.css({width:s+"px",height:k+"px"})}}var r=d.fn.cycle.transitions[f.fx];r&&r(v,q,f);q.each(function(){var h=d(this);this.cycleH=(f.fit&&f.height)?f.height:h.height();this.cycleW=(f.fit&&f.width)?f.width:h.width()});if(f.cssFirst){d(q[o]).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=l.length;f.currSlide=o;f.nextSlide=1;var t=q[o];if(f.before.length){f.before[0].apply(t,[t,t,f,true])}if(f.after.length>1){f.after[1].apply(t,[t,t,f,true])}if(f.click&&!f.next){f.next=f.click}if(f.next){d(f.next).bind("click",function(){return c(l,f,f.rev?-1:1)})}if(f.prev){d(f.prev).bind("click",function(){return c(l,f,f.rev?1:-1)})}if(f.timeout){this.cycleTimeout=setTimeout(function(){b(l,f,0,!f.rev)},f.timeout+(f.delay||0))}})};function b(j,e,i,k){if(e.busy){return}var h=j[0].parentNode,m=j[e.currSlide],l=j[e.nextSlide];if(h.cycleTimeout===0&&!i){return}if(i||!h.cyclePause){if(e.before.length){d.each(e.before,function(n,p){p.apply(l,[m,l,e,k])})}var f=function(){if(d.browser.msie){this.style.removeAttribute("filter")}d.each(e.after,function(n,p){p.apply(l,[m,l,e,k])})};if(e.nextSlide!=e.currSlide){e.busy=1;d.fn.cycle.custom(m,l,e,f)}var g=(e.nextSlide+1)==j.length;e.nextSlide=g?0:e.nextSlide+1;e.currSlide=g?j.length-1:e.nextSlide-1}if(e.timeout){h.cycleTimeout=setTimeout(function(){b(j,e,0,!e.rev)},e.timeout)}}function c(e,f,i){var h=e[0].parentNode,g=h.cycleTimeout;if(g){clearTimeout(g);h.cycleTimeout=0}f.nextSlide=f.currSlide+i;if(f.nextSlide<0){f.nextSlide=e.length-1}else{if(f.nextSlide>=e.length){f.nextSlide=0}}b(e,f,1,i>=0);return false}d.fn.cycle.custom=function(k,h,i,e){var j=d(k),g=d(h);g.css(i.cssBefore);var f=function(){g.animate(i.animIn,i.speedIn,i.easeIn,e)};j.animate(i.animOut,i.speedOut,i.easeOut,function(){j.css(i.cssAfter);if(!i.sync){f()}});if(i.sync){f()}};d.fn.cycle.transitions={fade:function(f,g,e){g.not(":eq(0)").hide();e.cssBefore={opacity:0,display:"block"};e.cssAfter={display:"none"};e.animOut={opacity:0};e.animIn={opacity:1}},fadeout:function(f,g,e){e.before.push(function(k,i,j,h){d(k).css("zIndex",j.slideCount+(h===true?1:0));d(i).css("zIndex",j.slideCount+(h===true?0:1))});g.not(":eq(0)").hide();e.cssBefore={opacity:1,display:"block",zIndex:1};e.cssAfter={display:"none",zIndex:0};e.animOut={opacity:0}}};d.fn.cycle.ver=function(){return a};d.fn.cycle.defaults={animIn:{},animOut:{},fx:"fade",after:null,before:null,containerResize:1,cssBefore:{},cssAfter:{},delay:0,fit:0,height:"auto",metaAttr:"cycle",next:null,pause:0,prev:null,speed:1000,slideExpr:null,sync:1,timeout:4000}})(jQuery);
