/* Return a random number between 0 and num */
function rand(num)
	{
		return (Math.floor(Math.random() *num));
	}

/* The following array holds the actual file names of the images that can be chosen randomly */
Images = new Array(14);
Images[0] = "hppic1.jpg";
Images[1] = "hppic2.jpg";
Images[2] = "hppic3.jpg";
Images[3] = "hppic4.jpg";
Images[4] = "hppic5.jpg";
Images[5] = "hppic6.jpg";
Images[6] = "hppic7.jpg";
Images[7] = "hppic10.jpg";
Images[8] = "hppic11.jpg";
Images[9] = "hppic12.jpg";
Images[10] = "hppic13.jpg";
Images[11] = "hppic14.jpg";
Images[12] = "hppic15.jpg";
Images[13] = "hppic16.jpg";
Images[14] = "hppic17.jpg";

/* The following array holds the captions of the images. Array numbers here correspond with the images array numbers */
Captions = new Array(14);
Captions[0] = "Farm in Little Meadows, 1887";
Captions[1] = "Forest City Breaker, 1902";
Captions[2] = "Building a Bridge in Middletown Center, 1905";
Captions[3] = "Demer Brothers, Hallstead, 1910 - Julian Campbell Photograph";
Captions[4] = "Jefferson House, Thompson, 1912 - Julian Campbell Photograph";
Captions[5] = "The Harford Methodist Church, 1912 - Julian Campbell Photograph";
Captions[6] = "Lawsville Store, early 1900s";
Captions[7] = "Herrick Center High School, circa 1922";
Captions[8] = "North Jackson Methodist Church, circa 1900";
Captions[9] = "Wheaton Family Farmhouse, Salt Springs, Franklin Twp, 1908";
Captions[10] = "A Rainy Day, West Auburn, Date Unknown";
Captions[11] = "Main Street, Hopbottom, circa 1912-1915 - Julian Campbell Photograph";
Captions[12] = "Montrose Green and Monument Square, Montrose, 1868";
Captions[13] = "Lathrop Farmhouse, Springville Twp., circa 1906-1907";
Captions[14] = "Pratt Memorial Library, New Milford, circa 1912-1915 - Julian Campbell Photograph";

/* Set this variable so that as the array shrinks or grows, we won't need to change the call to the random function. This will make it easier to maintain the list of images. */
NumberOfImages = Images.length;

/* Center the image */
document.write("<CENTER>");
document.write("<TABLE WIDTH=332 CELLSPACING=0 CELLPADDING=0 BORDER=0>");

/* Choose a random image from the list and display it and its caption on the web page */
ChosenImage = rand(NumberOfImages);

document.write("<TR><TD>");
document.write("<IMG SRC=", Images[ChosenImage], " WIDTH=332 HEIGHT=223 ALT=", Captions[ChosenImage], ">");
document.write("</TD></TR>");
document.write("<TR><TD ALIGN=center>");
document.write(Captions[ChosenImage]);
document.write("</TD></TR>");

/* Stop centering */
document.write("</TABLE>");
document.write("</CENTER>");