// This script selects a random element from an array, assigns variable values based on
// that element, and then prints the results in the browser window.

function randomNumber(n){
	var number = Math.floor(Math.random() * (n + 1));
	return number;
}

// STEP 1 of 2:  To add new photo, add an element to this array 'photoArray'
var photoArray = new Array();
	photoArray[0] = "00";
	photoArray[1] = "01";

// Calls the randomNumber function, and automatically chooses the right value for 'n'
var t = randomNumber((photoArray.length - 1));

// This variable replaces a large chunk of repetitive HTML code
var FILE_PATH = "./images/headers/";

var COPYRIGHT1 = " (Photo &copy;2002 PhotosByFeist.com)";
var COPYRIGHT2 = " (Photo &copy;2002 University Photography)";
var COPYRIGHT3 = "";

// STEP 2 of 2:  To add new photo, add an if statement corresponding to the photoArray value above
if (photoArray[t] == "00"){
 var filename = "isa.jpg";
 var caption = "The Pride of India, Taj Mahal";
}
if (photoArray[t] == "01"){
 var filename = "isa.jpg";
 var caption = "The Pride of India, Taj Mahal";
}



// -- Add new element if statements above this line ------------------------------
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>');
document.write('<td width="505" height="110" bgcolor="#ffffff" valign="top"><img src="'+ FILE_PATH + filename +'" width="505" height="110" border="0" alt="' + caption + '" /></td>');
document.write('<td width="100%" height="110" bgcolor="#ffffff" background="'+ FILE_PATH + 'banner.gif" valign="top">&nbsp;</td>');

document.write('</tr><tr>');
document.write('<td colspan="3" height="7" valign="top">&nbsp;&nbsp;&nbsp;&nbsp;<font size="-2" color="#999999">' + caption + '</font></td></tr></table>');
document.close();