var numGraphics = 5;	// <=== 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();
	theGraphic = "http://library.smu.edu.sg/images/home_masthead/lib" + theGraphicNumber + '.jpg';
	theCaption = "http://library.smu.edu.sg/includes/captions/photo" + theGraphicNumber + '.js';
	return theGraphic;
	return theCaption;
	}
function loadGraphic() {
	theGraphic = getGraphic();
	//	var theTag = '<a href="/index.asp">';
	var theTag = '<img src="' + theGraphic + '"';
	//	theTag += '<img src="' + theGraphic + '"';
	//	theTag += ' alt="CEC" width="960" height="200" /></a>';
	theTag += ' alt="Li Ka Shing Library" border="0" />' ;
	// Put in the captions here
	document.write(theTag);
	}

initGraphics();