//* display random picture *//
//* consumed by index.shtml *//

// create array with information about the images
// filename,description,link
var imglist = new Array(
	new Array("1114050279_5705-1_dd_enhanced_456-A462R1_th418.gif",
		"Dust devils captured by Spirit on sol 456.",
		"http://marsrovers.jpl.nasa.gov/gallery/press/spirit/20050421a.html"),
	new Array("legacypanoramasm.jpg",
		"Part of a beautiful panorama taken by Spirit on sols 59-61.",
		"http://marsrovers.jpl.nasa.gov/gallery/press/spirit/20050208a.html"),
	new Array("oppheatshimpact.jpg",
		"Impact site of Opportunity's heat shield.",
		"http://marsrovers.jpl.nasa.gov/gallery/press/opportunity/20050203a.html"),
	new Array("burnscliff.jpg",
		"View of Burn's Cliff in Endurance Crater by Opportunity.",
		"http://marsrovers.jpl.nasa.gov/gallery/press/opportunity/20041213a.html"),
	new Array("sol326_fromsol149-A332R1_br.jpg",
		"Spirit's trek up to sol 326.",
		"http://marsrovers.jpl.nasa.gov/gallery/press/spirit/20041207a.html"),
	new Array("apprendurancecrater.jpg",
		"Part of a panorama of Opportunity's view of Endurance Crater.",
		"http://marsrovers.jpl.nasa.gov/gallery/press/opportunity/20040615a/11-SM-01-Endurance-A160R1_br2.jpg"),
	new Array("cahokia.jpg",
		"Part of Spirit's stunning \"Cahokia\" panorama of the Columbia Hills.",
		"http://marsrovers.jpl.nasa.gov/gallery/press/spirit/20041007a/05-JB-01-Cahokia_Pan-A249R1_br2.jpg"),
	new Array("wopmay.jpg",
		"An interesting rock called \"Wopmay\" possibly made lumpy by water.",
		"http://marsrovers.jpl.nasa.gov/gallery/press/opportunity/20041007a/11-JG-03-Brain-B251R1_br.jpg"),
	new Array("mera_sol270_P2535_TRUE-A278R1_br.jpg",
		"Layered outcrops in Gusev Crater, as a human might see them.",
		"http://marsrovers.jpl.nasa.gov/gallery/press/spirit/20041014a/mera_sol270_P2535_TRUE-A278R1_br2.jpg"),
	new Array("07-OSS-02-Dunes-B202R1_br.jpg",
		"Sand dunes on the floor of Endurance Crater.",
		"http://marsrovers.jpl.nasa.gov/gallery/press/opportunity/20040818a/07-OSS-02-Dunes-B202R1.jpg"),
	new Array("enduranceclouds.jpg",
		"Water vapor clouds above Endurance Crater.",
		"http://marsrovers.jpl.nasa.gov/gallery/press/opportunity/20041213a/merb_sol291_clouds-B313R1.jpg"),
	new Array("freshdigs.jpg",
		"Fresh digs by Opportunity in Endurance Crater.",
		"http://marsrovers.jpl.nasa.gov/gallery/press/opportunity/20040701a/Sol150B_P2575_L456-B156R1_br2.jpg"),
	new Array("potofgold.jpg",
		"Close-up of the hematite-rich rock \"Pot of Gold\" found by Spirit.",
		"http://marsrovers.jpl.nasa.gov/gallery/press/spirit/20040625a/03-SS-03-MI3-A170R1_br2.jpg"),
	new Array("trench.jpg",
		"Some trenches dug by Opportunity to see what lies beneath the surface.",
		"http://marsrovers.jpl.nasa.gov/gallery/press/opportunity/20040428a/09-SM-02-TrenchPan-B093R1_br2.jpg"),
	new Array("blueberries.jpg",
		"A picture of the famous \"blueberries\" that have yielded clues about liquid water.",
		"http://marsrovers.jpl.nasa.gov/gallery/press/opportunity/20040318a/18-AK-03-mi-A074R1.jpg")
);
var random = Math.random();
var choice = Math.floor(random*imglist.length);
var imginfo = imglist[choice];
var imageurl = imginfo[0];
var description = imginfo[1];
var link = imginfo[2];
document.write("<table width=300><tr>");
document.write("<td width=300 style=\"background-color:#5089da;\"><center>");

// check to see if we are linking to the image or to a specified url
if(imageurl == "n/a"){ // if there's no url, link to itself
	document.write("<a href=\"images/featured_pics/" + imageurl + "\">");
}
else{
	document.write("<a href=\"" + link + "\">");
}
document.write("<img border=0 src=\"images/featured_pics/" + imageurl + "\" width=296></a></center>");
document.write(description + "</td></tr></table>");