theImages[0] = 'images/homepic01.jpg'
theImages[1] = 'images/homepic02.jpg'
theImages[2] = 'images/homepic03.jpg'
theImages[3] = 'images/homepic04.jpg'

theImagesSmall[0] = 'images/sidepic01.jpg'
theImagesSmall[1] = 'images/sidepic02.jpg'
theImagesSmall[2] = 'images/sidepic03.jpg'
theImagesSmall[3] = 'images/sidepic04.jpg'

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="'+theImages[whichImage]+'" width="750" height="150" vspace="0" border="0">');
}

function showImageSmall(){
document.write('<img src="'+theImagesSmall[whichImage]+'" width="150" height="200" vspace="0" border="0">');
}