// uu_quote.js
// Last Updated: "2010-01-19 Tue 23:15:27"

// require uu_ajax.js

var quotes = new Array;

function initQuote() {
	xmlhttp = createXMLHttp();
	if(xmlhttp) {
		xmlhttp.onreadystatechange = setQuoteData;
		xmlhttp.open("GET", "uu_quotes.txt");
		xmlhttp.send(null);
	}
}

function setQuoteData() {
	if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
		quotes = xmlhttp.responseText.split("\n");
		randomQuote();
	}
}

function randomQuote() {
	var num = Math.floor(Math.random() * (quotes.length - 1)); // magick number -1
	document.getElementById("quote").innerHTML = quotes[num];
	document.getElementById("quote-who").innerHTML += '<span id="quote-next">&gt;&gt;</span>';
}

window.onload = initQuote;
