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 p = theImages.length;
var preBuffer = new Array()

for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}

var whichImage1 = Math.round(Math.random()*(p-1));
var whichImage2 = whichImage1;

while (whichImage1 == whichImage2) {
   whichImage2 = Math.round(Math.random()*(p-1));
}

function showImage(){
document.write('<img src="'+theImages[whichImage1]+'" width="750" height="150" vspace="0" border="0">');
}

function showImageSmall(){
document.write('<img src="'+theImagesSmall[whichImage2]+'" width="150" height="200" vspace="0" border="0">');
}
