﻿<!--

// Random banner graphic

var numGraphics = 7;	// <=== Adjust the number of image files here
var theGraphics = null;
function getRandomNumber(n) {
	//Returns a pseudorandom number between 1 and n
	today = new Date();
	var bigNum = today.getSeconds() * today.getTime() * Math.sqrt(today.getMinutes());
	var randNum = (bigNum % n) + 1;
	return Math.floor(randNum);
	}
function initArray(n) {
	this.length = n;
	for(var i = 1; i <= n; i++) {
		this[i] = "";
		}
	return this;
	}
function initGraphics() {
	theGraphics = new initArray(numGraphics);
	for(i = 1; i <= numGraphics; i++) {
		theGraphics[i] = i;
		}
	}
function getRandomGraphic() {
	var theIndex = getRandomNumber(numGraphics);
	return theGraphics[theIndex];
	}
function getGraphic() {
	var theGraphicNumber = getRandomGraphic();
	theBackground = "http://www.dartmouth.edu/presidentsearch/files/graphics/banners/banner" + theGraphicNumber + '.jpg';
	return theBackground;
	}
function loadGraphic() {
	theBackground = getGraphic();
	var theTag = '<div style="background: #e7ece7 url(' + theBackground + ') no-repeat right" id="screen_banner">\r\r';
	document.write(theTag);
	}

initGraphics();