var theImages = new Array()

theImages[0] = 'rock.png'
theImages[1] = 'feather.png'
theImages[2] = 'poppy.png'

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(){
if(whichImage==0){
document.write('<img src="images/'+theImages[whichImage]+'" border=0 width=385 height=280>');
}
else if(whichImage==1){
document.write('<img src="images/'+theImages[whichImage]+'" border=0 width=385 height=280>');
}
else if(whichImage==2){
document.write('<img src="images/'+theImages[whichImage]+'" border=0 width=385 height=280>');
}

}
