// Rotates through different pictures on page load
// Pictures must be saved as 450 x 225 pixels.

//Number of images to rotate through
var num_imgs = 18;

//Captions for each image
var caption = new Array()
caption[1] = "UW Madison Flag and Lincoln Statue";
caption[2] = "Lincoln Statue in front of Bascom Hall";
caption[3] = "Lincoln Statue with tie-dye banners at Bascom Hall";
caption[4] = "Lincoln Statue with Bascom Hall backdrop";
caption[5] = "Winter on Bascom Hill";
caption[6] = "Bascom Hall with sky backdrop";
caption[7] = "Students walking in front of Bascom Hall";
caption[8] = "Lincoln Statue with Bascom Hall backdrop";
caption[9] = "Fish-eye view of Bascom Hall";
caption[10] = "Bascom Hall in the Fall";
caption[11] = "Garden outside Bascom Hall";
caption[12] = "Bascom Hall in the Fall";
caption[13] = "Fish-eye view of Bascom Hall";
caption[14] = "Bascom Hall in the Winter";
caption[15] = "Angled view of Bascom Hall";
caption[16] = "View down Bascom Hill";
caption[17] = "Angled view of Bascom Hill";
caption[18] = "A lone walker on Bascom Hill in Winter";

//Random image number stored into random_img
var random_img = Math.floor(Math.random()*num_imgs) + 1;

for (x=1;x<=num_imgs;x++) {
	if (x==random_img) {
		caption_true = caption[x];
	}
}

var img_name = "http://www.wisc.edu/students/saja/images/topimg/" + random_img + ".jpg";

var total_output = "<img src=\" " + img_name + " \" alt=\" " + caption_true + " \" />";

document.writeln(total_output);




