/*
	jQuery cycle v2.1
	
	Wouter Beeftink
	wouter@footsteps.nl
*/
(function($){$.fn.cycle=function(f){var f=$.extend({keep:false,interval:5000,navigation:false,navigationKeep:false,next:true,nextLabel:'Volgende',numbers:true,previous:true,previousLabel:'Vorige',rotate:true,speed:1000,start:0,startShown:true},f);function callback(a,b,c){var d=f[a];if($.isFunction(d))d.call(b,c)};function createNavigation(){if(typeof f.navigation=='string')navigation=$(f.navigation);else if(typeof f.navigation=='object')navigation=f.navigation;else navigation=$('<div class="navigation" />').insertAfter(g.eq(amount-1));navigationButtons={};if(f.previous){var b=createButton(f.previousLabel,'previous',function(a){g.showPrevious();a.preventDefault()});navigation.append(b);navigationButtons['previous']=b};if(f.numbers){navigationButtons['numbers']=[];for(var i=0;i<amount;i++){var c=createButton(i+1,'link',function(a){g.showIndex($(this).data('index'));a.preventDefault()},i);navigation.append(c);navigationButtons['numbers'].push(c)}};if(f.next){var d=createButton(f.nextLabel,'next',function(a){g.showNext();a.preventDefault()});navigation.append(d);navigationButtons['next']=d}};function createButton(a,b,c,d){var e=$('<a href="">'+a+'</a>').addClass(b).click(c);if(d>=0){e.data('index',d).attr('id',b+'-'+d)};if(d==0)e.addClass('first');if(d==amount-1)e.addClass('last');return e};this.showIndex=function(b,c){callback('beforeCycle',this);if(currentIndex!=b){this.hide();if(c){this.eq(f.start).show()}else{this.stop();if(currentIndex>=0){g.eq(currentIndex).css({'display':'block','z-index':1,'opacity':1})};g.eq(b).css({'display':'block','z-index':2,'opacity':0}).animate({'opacity':1},f.speed)};currentIndex=b;if(f.navigation&&f.numbers){var d=navigationButtons['numbers'];$.each(d,function(a){if(a==currentIndex)$(this).addClass('active');else $(this).removeClass('active')})};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(){g.showNext()},f.interval);callback('onStart',this)};h=false};this.pauseCycle=function(){callback('beforePause',this);if(this.isAnimated()){window.clearInterval(timer);timer=null;callback('onPause',this)};h=false};this.stopCycle=function(){callback('beforeStop',this);if(this.isAnimated()){window.clearInterval(timer);timer=null;callback('onStop',this)};h=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 g=this,amount=this.length,navigation=null,navigationButtons=null;if(amount>1){callback('beforeLoad');var h=f.rotate,currentIndex=null,timer=null;this.css('position','absolute');if(f.navigation)createNavigation();this.showIndex(f.start,f.startShown);if(f.rotate)this.startCycle();if(f.keep){this.hover(function(){g.pauseCycle()},function(){if(!h)g.startCycle()})};if(f.navigationKeep){navigation.hover(function(){g.pauseCycle()},function(){if(!h)g.startCycle()})};callback('onLoad')};return this}})(jQuery);
