/* 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(10);
Images[0] = "images/products/the_dvc-500_soker.jpg";
Images[1] = "images/products/the_p36.jpg";
Images[2] = "images/products/the_santa_fe.jpg";
Images[3] = "images/products/castile.jpg";
Images[4] = "images/products/elite.jpg";
Images[5] = "images/products/gas_logs.jpg";
Images[6] = "images/products/the_7100fp.jpg";
Images[7] = "images/products/c550.jpg";
Images[8] = "images/products/classicbay1200.jpg";
Images[9] = "images/products/magnum_stoker.jpg";
Images[10] = "images/products/vf3000.jpg";
Images[11] = "images/products/electric.jpg";
/*Images[12] = "hppic16.jpg";*/
/*Images[13] = "hppic17.jpg";*/

/* The following array holds the captions of the images. Array numbers here correspond with the images array numbers */
Captions = new Array(10);
Captions[0] = "The DVC 500 Coal Stoker";
Captions[1] = "The P 36 Gas Fireplace";
Captions[2] = "The Santa Fe Gas stove";
Captions[3] = "The Castile Pellet stove";
Captions[4] = "The Harman Magnafire Coal Stove Elite Insert";
Captions[5] = "Modern Gas Logs give the perfect illusion of real burning wood";
Captions[6] = "The Quadrafire 7100 Wood Fireplace";
Captions[7] = "The Jotul C 550 Rockland Wood Insert shown in Classic Matte Black";
Captions[8] = "The Quadrafire Classic Bay 1200 Pellet Stove";
Captions[9] = "The Harman Magnum Coal Stoker";
Captions[10] = "Harman VF3000 Verti-Flow Stoker Boiler";
Captions[11] = "Electric Fireplace with lifelike flame technology";
/*Captions[12] = "Lathrop Farmhouse, Springville Twp., circa 1906-1907";*/
/*Captions[13] = "Pratt Memorial Library, New Milford, Date Unknown - 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=384 /*HEIGHT=223*/ ALT=", Captions[ChosenImage], ">");
document.write("</TD></TR>");
document.write("<tr><td align = center /*bgcolor='#0c3d25'*/> <p class='captions' align = center>");
document.write("<b>");
document.write(Captions[ChosenImage]);
document.write("</b>");
document.write("</TD></TR>");

/* Stop centering */
document.write("</TABLE>");
document.write("</CENTER>");

