var mastheads = new Array(6);
for (var i=0;i<mastheads.length;++i)
{
	mastheads[i] = new Image();
	mastheads[i].src = "/images/homepage/masthead"+i+".jpg";
}

function getRandomNumber(N) { return Math.floor(N*(Math.random()%1)) }

function rotateMasthead()
{
	var oImage = document.getElementById("mastheadImage");
	if (!oImage) return;

	var sNewURL = oImage.src;
	while (sNewURL == oImage.src)
		sNewURL = mastheads[getRandomNumber(mastheads.length)].src;

	oImage.src = sNewURL;
	setMastheadTimer();
}

function setMastheadTimer() { setTimeout("rotateMasthead()", 5000); }