Stage = function(ctrl, prev, next) {
	this.lineup = getElementsByTagAndClassName('div', 'item', $('stage'))
	for (i=0;i< this.lineup.length;i++) {
		if (this.current === null) this.show(i)
	}
	if (this.lineup.length > 1) {
		connect(prev, 'onclick', bind(this.prev, this))
		connect(next, 'onclick', bind(this.next, this))
		appear(ctrl)
	}
}
Stage.prototype = {
	current:null,
	lineup:[],
	show:function(i){
		if (this.current == i) return
		if (this.current !== null) {
			fade(this.lineup[this.current])
		}
		this.current = i
		appear(this.lineup[this.current])
	},
	prev: function() {
		if (this.current > 0) this.show(this.current - 1)
	},
	next: function() {
		if (this.current < this.lineup.length - 1) this.show(this.current + 1)
	}
}
addLoadEvent(function(ev) {
	var stage = new Stage($('ctrl'), $('prev'), $('next'))
})
