/*
	jQuery cycle v2.05
	
	Wouter Beeftink
	wouter@footsteps.nl
*/
(function($){$.fn.cycle=function(e){var e=$.extend({start:0,startShown:true,rotate:true,speed:1000,interval:5000,keep:false},e);function callback(a,b,c){var d=e[a];if($.isFunction(d))d.call(b,c)};this.showIndex=function(a,b){callback('beforeCycle',this);if(currentIndex!=a){this.hide();if(b){this.eq(e.start).show()}else{this.stop();if(currentIndex>=0){f.eq(currentIndex).css({'display':'block','z-index':1,'opacity':1})};f.eq(a).css({'display':'block','z-index':2,'opacity':0}).animate({'opacity':1},e.speed)};currentIndex=a;if(timer){this.stopCycle();this.startCycle()};callback('onCycle',this)}};this.showPrevious=function(){this.showIndex(this.getPreviousIndex())};this.showNext=function(){this.showIndex(this.getNextIndex())};this.startCycle=function(){callback('beforeStart',this);if(!this.isAnimated()){timer=window.setInterval(function(){f.showNext()},e.interval);callback('onStart',this)};g=false};this.pauseCycle=function(){callback('beforePause',this);if(this.isAnimated()){window.clearInterval(timer);timer=null;callback('onPause',this)};g=false};this.stopCycle=function(){callback('beforeStop',this);if(this.isAnimated()){window.clearInterval(timer);timer=null;callback('onStop',this)};g=true};this.isAnimated=function(){return timer?true:false};this.getCurrentIndex=function(){return currentIndex};this.getPreviousIndex=function(){return currentIndex==0?amount-1:currentIndex-1};this.getNextIndex=function(){return currentIndex==amount-1?0:currentIndex+1};this.getAmount=function(){return amount};var f=this,amount=this.length;if(amount>1){callback('beforeLoad');var g=e.rotate,currentIndex=null,timer=null;this.css('position','absolute');this.showIndex(e.start,e.startShown);if(e.rotate)this.startCycle();if(e.keep){this.hover(function(){f.pauseCycle()},function(){if(!g)f.startCycle()})};callback('onLoad')};return this}})(jQuery);