var slider = new Class({
	Implements: Events,
	current: 1,
	delay: 5000,
	panes: false,
	timer: false,
	initialize: function(){
		this.panes = $('strip-inner').getChildren();
		this.panes.addEvent('click', this.click.bindWithEvent(this));
		this.timer = this.next.delay(this.delay, this);		
	},
	click: function(e){
		clearTimeout(this.timer);
		this.view($(e.target));
	},
	next: function(){
		this.current = (this.current < this.panes.length) ? this.current + 1 : 1;
		this.view(this.panes[this.current-1]);
	},
	view: function(el){
		el.getSiblings().tween('width', 33);
		el.tween('width', 880);
		this.current = el.getAllPrevious().length + 1;
		this.timer = this.next.delay(this.delay, this);	
	}
});

window.addEvent('domready', function(){
	new slider;
});
