﻿var acties = new Class({
	initialize: function() {		  
		this.interval = 3000;
		this.active = 0;
		this.getActies();
		this.pauze = 0;
	},
    
	getActies: function(){		
		this.items = $$("#actie .actie");
		if(this.items.length>1)	this.show();		
	},
	
	show: function(){
		var el = this.items[this.active];
		if (this.pauze == 0) {
			if(this.active == this.items.length-1) this.active = -1;
			var el2 = this.items[this.active+1];
			el.setStyle('display','none');		
			el2.setStyle('display','block');		
			this.active = this.active + 1;
			if(this.active == this.items.length) this.active = 0;		
		}
		this.show.delay(this.interval,this);
	},
	
	pauzeren: function() {
		this.pauze = 1;
	},
	
	doorgaan: function() {
		this.pauze = 0;
	}
	
		
});
