var theImages = new Array() // do not change this

theImages[0] = 'animated1.gif'
theImages[1] = 'animated2.gif'
theImages[2] = 'animated3.gif'
theImages[3] = 'animated4.gif'
theImages[4] = 'animated5.gif'
theImages[5] = 'animated6.gif'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="gifs/'+theImages[whichImage]+'" border=1px>');
}