var theImages = new Array() 

theImages[0] = 'images/sidebar/001.jpg'
theImages[1] = 'images/sidebar/002.jpg'
theImages[2] = 'images/sidebar/003.jpg'
theImages[3] = 'images/sidebar/004.jpg'
theImages[4] = 'images/sidebar/005.jpg'
theImages[5] = 'images/sidebar/006.jpg'
theImages[6] = 'images/sidebar/007.jpg'
theImages[7] = 'images/sidebar/008.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]+'">');
}

