QuoteRotate = {
	index: 0,
	quotes: null,
	register: function (div_id) {
		var oldWindowOnLoad = window.onLoad;
		var that = this;
		window.onload = function () {
			that.registerOnLoad(div_id);
			if (oldWindowOnLoad) {
				oldWindowOnLoad();
			}
		};
	},
	registerOnLoad: function (div_id) {
		var div = document.getElementById(div_id);
		this.quotes = new Array();
		for (var i=0; i<div.childNodes.length; i++) {
			var node = div.childNodes[i];
			if (node.className == 'quote') {
				this.quotes.push(node);
			}
		}
		this.index = Math.floor(Math.random() * this.quotes.length);
		this.step();
		var that = this;
		setInterval(function () { that.step(); }, 5000);
	},
	step: function () {
		this.quotes[this.index].className = 'quote';
		++this.index;
		this.index = this.index % this.quotes.length;
		this.quotes[this.index].className = 'quote_visible';
	}
};