// Set up the image files to be used for the first book cover.
cover1 = new Array
// To add more cover images, continue with the pattern below, adding to the array.
	("../images/ieor_cover01.jpg",
	 "../images/ieor_cover03.jpg",
	 "../images/ieor_cover05.jpg",
	 "../images/ieor_cover07.jpg",
	 "../images/ieor_cover09.jpg",
	 "../images/ieor_cover11.jpg",
	 "../images/ieor_cover13.jpg",
	 "../images/ieor_cover15.jpg",
	 "../images/ieor_cover17.jpg",
	 "../images/ieor_cover19.jpg")

// Set up the links to the first set of books.
// The first link in the array matches the first cover listed in the book cover array, etc.
link1 = new Array
	("http://berkeley.worldcat.org/oclc/298775344?referer=list_view",
	 "http://berkeley.worldcat.org/oclc/289095889?referer=list_view",
	 "http://berkeley.worldcat.org/oclc/277253656?referer=list_view",
	 "http://berkeley.worldcat.org/oclc/226038323?referer=list_view",
	 "http://berkeley.worldcat.org/oclc/294955829?referer=list_view",
	 	"http://berkeley.worldcat.org/oclc/320800090?referer=list_view",
	 	"http://berkeley.worldcat.org/oclc/359673669?referer=list_view",
	 	"http://berkeley.worldcat.org/oclc/319946414?referer=list_view",
	 	"http://berkeley.worldcat.org/oclc/236117327?referer=list_view",
	 	"http://berkeley.worldcat.org/oclc/178292482?referer=list_view")

// This sets a counter to the total number of items in each of the two arrays.
// The value of the counter is used by the random number generator.
imgCt1 = cover1.length;

/* This function selects a random number to determine which book cover image
will be displayed, and the corresponding link to the book is activated.   */
function showImage1(){
	if (document.images) {    // if the document can handle images (it can)
	randomNum1 = Math.floor ((Math.random() * imgCt1))   // This is the random number generator
	}
// the XHTML is generated (book cover #1 with active link to the full text)
document.write('<a href="'+link1[randomNum1]+'"><img src="'+cover1[randomNum1]+'"></a>');
}
