var theImages = new Array()

theImages[0] = '01'
theImages[1] = '02'
theImages[2] = '03'
theImages[3] = '04'
theImages[4] = '05'
theImages[5] = '06'
theImages[6] = '07'
theImages[7] = '08'
theImages[8] = '09'
theImages[9] = '10'

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="images/home_pic_'+theImages[whichImage]+'.jpg" width="800" height="521" />');
}