// Set up the image and alt files to be used.
var images = new Array();
var titles = new Array();

images[0] = 'andrea1.jpg';
titles[0] = 'Dressed for the Weather';
//images[1] = 'andrea2.jpg';
//titles[1] = 'Me Biking';
//images[2] = 'andrea3.JPG';
//titles[2] = 'At a Formal';
//images[3] = 'andrea4.jpg';
//titles[3] = 'A Bear on my head';
//images[4] = 'andrea5.jpg';
//titles[4] = 'Climbing';
//images[5] = 'andrea6.jpg';
//titles[5] = 'Sailing';
//images[6] = 'andrea7.jpg';
//titles[6] = 'Tire Swing';
//images[7] = 'andrea8.jpg';
//titles[7] = 'Elasticube';

images[1] = 'andrea6.jpg';
titles[1] = 'Sailing';
images[2] = 'andrea7.jpg';
titles[2] = 'Tire Swing';

//How many images are there?
var numImages = images.length;

var preBuffer = new Array()
for (i = 0; i < numImages; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = images[i]
}

//Randomly select an image
var whichImage = Math.round(Math.random()*(numImages-1));

//this function shows the image
function showImage(){
   document.write('<img src="'+images[whichImage]+'" title="'+titles[whichImage]+'" alt="'+titles[whichImage]+'" width="200" class="right"/>');
}
