var theImages = new Array()

theImages[0] = 'Gallery/sp/sp1.jpg'
theImages[1] = 'Gallery/sp/sp2.jpg'
theImages[2] = 'Gallery/sp/sp3.jpg'
theImages[3] = 'Gallery/sp/sp4.jpg'
theImages[4] = 'Gallery/sp/sp5.jpg'
theImages[5] = 'Gallery/sp/sp6.jpg'
theImages[6] = 'Gallery/sp/sp7.jpg'
theImages[7] = 'Gallery/sp/sp8.jpg'
theImages[8] = 'Gallery/sp/sp9.jpg'
theImages[9] = 'Gallery/sp/sp10.jpg'
theImages[10] = 'Gallery/sp/sp11.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]+'">');
}

