
// initialize the list of pictures.  Set the length of pic_array to be
// exactly the number of pictures that will be available.
var pic_array = new Array(11);

for (i = 0; i < pic_array.length; i++) {
    pic_array[i] = new Object();
}

// Add the pictures to the list.  Each picture must specify its
// location relative from the images directory, its height, its width,
// the text to be put in the alt tag, and a brief description of the
// picture.
pic_array[0].location = "yosemite/bridalveil_falls.jpg";
pic_array[0].width = 400;
pic_array[0].height = 300;
pic_array[0].alt_text = "Bridalveil Falls";
pic_array[0].description = "Bridalveil Falls, Yosemite National Park, CA";

pic_array[1].location = "monterey-bay.jpg";
pic_array[1].width = 400;
pic_array[1].height = 299;
pic_array[1].alt_text = "Monterey Bay";
pic_array[1].description = "Monterey Bay seen from Scotts Valley, CA";

pic_array[2].location = "yosemite/el_capitan.jpg";
pic_array[2].width = 244;
pic_array[2].height = 326;
pic_array[2].alt_text = "El Capitan";
pic_array[2].description = "El Capitan, Yosemite National Park, CA";

pic_array[3].location = "yosemite/lower_yosemite_falls.jpg";
pic_array[3].width = 400;
pic_array[3].height = 300;
pic_array[3].alt_text = "Lower Yosemite Falls";
pic_array[3].description = "Lower Yosemite Falls, Yosemite National Park, CA";

pic_array[4].location = "yosemite/cathedral_rocks_and_spires.jpg";
pic_array[4].width = 400;
pic_array[4].height = 300;
pic_array[4].alt_text = "Cathedral Rocks and Spires";
pic_array[4].description = "Cathedral Rocks and Spires, Yosemite National Park, CA";

pic_array[5].location = "yosemite/valley.jpg";
pic_array[5].width = 400;
pic_array[5].height = 300;
pic_array[5].alt_text = "Yosemite Valley";
pic_array[5].description = "Yosemite Valley, Yosemite National Park, CA";

pic_array[6].location = "big-basin/broken-tree.jpg";
pic_array[6].width = 400;
pic_array[6].height = 300;
pic_array[6].alt_text = "Broken tree";
pic_array[6].description = "Big Basin National Park, CA";

pic_array[7].location = "big-basin/fallen-tree.jpg";
pic_array[7].width = 400;
pic_array[7].height = 300;
pic_array[7].alt_text = "Fallen tree";
pic_array[7].description = "Big Basin National Park, CA";

pic_array[8].location = "big-basin/meadow.jpg";
pic_array[8].width = 400;
pic_array[8].height = 300;
pic_array[8].alt_text = "Meadow";
pic_array[8].description = "Big Basin National Park, CA";

pic_array[9].location = "big-basin/stream.jpg";
pic_array[9].width = 400;
pic_array[9].height = 300;
pic_array[9].alt_text = "Stream";
pic_array[9].description = "Big Basin National Park, CA";

pic_array[10].location = "big-basin/tall_trees.jpg";
pic_array[10].width = 271;
pic_array[10].height = 363;
pic_array[10].alt_text = "Tall trees";
pic_array[10].description = "Big Basin National Park, CA";

// randomly select and display a picture
var index = Math.floor(Math.random() * pic_array.length);

document.write("<p align=center>");
document.write("<img src=images/");
document.write(pic_array[index].location);
document.write(" alt=");
document.write(pic_array[index].alt_text);
document.write(" width=");
document.write(pic_array[index].width);
document.write(" height=");
document.write(pic_array[index].height);
document.write("><br>");
document.write(pic_array[index].description);
