RoaImageRotator = Class.create({
	delay: null,
	count: null,
	current: null,
	initialize: function(delay) {
	    this.delay = delay * 1000;
	    this.count = $('roaImageRotator').select('img').size();
	    this.current = 0;

	    this.showCurrent();
	    setInterval("roaImageRotator.showNext();", this.delay);
	},
	showCurrent: function() {
	    $('roaImageRotator').down('img', this.current).removeClassName('hidden');
	},
	showNext: function() {
	    // hide current
	    $('roaImageRotator').down('img', this.current).addClassName('hidden');
	    // step forward (or loop)
	    this.current = (this.current + 1)%this.count;
	    // show current
	    this.showCurrent();
	}
});

var roaImageRotator;

