var brenner = new Class({
	initialize: function(items,options){
		if(options) for(var o in options) this[o]=options[o];
		this._current = 0;
		this._previous = null;
		this.items = items.setStyle('display','none');
		this.items[this._current].setStyle('display','block');
		this.disabled = false;
		this.timer = null;
	},
	walk: function(n,manual){
    var dd='';
		if(this._current!==n && !this.disabled){
			this.disabled = true;
			if(manual){this.stop();}
			this._previous = this._current;
			this._current = n;
      for(var j=0;j<this.items.length;j++)
                {if(j !== this._previous){  this.items[j].setStyles({'display':'none','z-index':'0'});}}
      this.items[this._previous].setStyles({'z-index':'1'});
      this.items[this._current].setStyles({'display':'block','z-index':'2','opacity':'0'}); 
			this.items[this._current].set('tween',{duration:1000,onComplete:this.onComplete.bind(this)}).fade('in');
		}
	},
	play: function(wait){
		this.stop();
		if(!wait){this.next();}
		this.timer = this.next.periodical('7000',this,[false]);
	},
	stop: function(){$clear(this.timer);},
	next: function(manual){
	  if(this._current+1 < this.items.length){ this.walk(this._current+1,manual); }
          else { this.walk(0,manual); }
	},
	onComplete: function(){
		this.disabled = false;
		this.items[this._previous].setStyle('display','none','opacity','0');
	}
});
