/* randomise script
Author: Elle Meredith
Version: 2009 Jan 18
*/

var anecdotes = new Array();
anecdotes[0] = "<p>Regatta race. MQ was leading when the passage boat Crystal Wave capsized and went to the assistance of her crew. The race was re-held on 7/12 in blustery conditions and after part of her rigging gave way May Queen (which was favourite) retired.</p><p><cite>&#8212;5 December 1877</cite></p>";
anecdotes[1] = "<p>Construction of  ketch commenced at Franklin  based on wooden scale model by Alexander Lawson for William Thorpe. Built of stringy bark and blue gum. Planks fastened with trunnels.</p><p><cite>&#8212;1865</cite></p>";
anecdotes[2] = "<p>Collision with the steamship Esk in Storm Bay after leaving Port Arthur. Bowsprit broken off and the boom struck by the stern of the Esk. No serious damage but an inquiry conducted under the Wrecks Inquiries Act.</p><p><cite>&#8212;4 June 1883</cite></p>";
anecdotes[3] = "<p>Technical piracy. Crewman W Evans was charged  when he took the MQ to sea without a masters certificate after a disagreement with the skipper T Tuttle. Fined $50</p><p><cite>&#8212;14 December 1972</cite></p>";
anecdotes[4] = "<p>MQ under Capt E McKavoy sank between Police Point and Huon Island in about 17 fathoms of water after being hit by a sudden squall. No loss of life and the vessel was dragged in to 8 fathoms by the &#8216;One and All&#8217; and the &#8216;Alabama&#8217; by the 16th March and raised without difficulty.</p><p><cite>&#8212;16 February 1888</cite></p>";
anecdotes[5] = "<p>MQ sailed for Garden Island Creek loaded with a 40hp boiler for installation in a new sawmill for Henry Chesterman and partners.</p><p><cite>&#8212;27 February 1875</cite></p>";

function randomise() {
	if (!document.getElementById) return false;
	if (!document.getElementById("anecdote")) return false;
	var anecdote_count = anecdotes.length;
	var random_num = Math.floor ((Math.random() * anecdote_count));
	var selected_anecdote = anecdotes[random_num];
	var anecdote = document.getElementById("anecdote");
	anecdote.innerHTML = selected_anecdote;

}

/* function by Simon Willison (http://simon.incutio.com/) */
function addLoadEvent(func) {
	var oldonload = window.load;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

addLoadEvent(randomise);