/*******************************
	rotate.js
	
	Rotates the main image on the HMD homepage

*******************************/


// Variables
var imagePath = 'images/rotate/'; // Path to images

var imageChoices = new Array(); // Create our container for all image arrays

imageChoices[0] = new Array('front_acquisitions.jpg','272','212','Recent Acquisitions','http://www.nlm.nih.gov/happening/recentacquisitions.html');
imageChoices[0] = new Array('front_dreamAnatomy.jpg','272','212','Dream Anatomy','http://www.nlm.nih.gov/exhibition/dreamanatomy/index.html');
imageChoices[1] = new Array('front_frankenstein.jpg','272','229','Frankenstein, Penetrating the Secrets of Nature','http://www.nlm.nih.gov/exhibition/frankenstein/index.html');
imageChoices[2] = new Array('front_greekMedicine.jpg','272','212','Greek Medicine','http://www.nlm.nih.gov/hmd/greek/index.html');
imageChoices[3] = new Array('front_hereToday.jpg','272','212','Here Today, Here Tomorrow','http://www.nlm.nih.gov/exhibition/ephemera/index.html');
imageChoices[4] = new Array('front_islamicManuscripts.jpg','272','229','Islamic Medical Manuscripts at the NLM','http://www.nlm.nih.gov/hmd/arabic/welcome.html');
imageChoices[5] = new Array('front_profiles.jpg','272','212','Profiles in Science','http://profiles.nlm.nih.gov/');


function chooseImage(choices) {
	// Pick a random number between 0 and number of images
	var selection = Math.floor(Math.random() * choices.length);	
	var myImage = choices[selection];
	
	document.write('<a href="'+ myImage[4] +'"><img src="'+ imagePath + myImage[0] +'" alt="'+ myImage[3] +'" width="'+ myImage[1] +'" height="'+ myImage[2] +'" border="0" /></a>');


}
chooseImage(imageChoices)
