var theImages = new Array()
theImages[0] = 'r0.jpg'
theImages[1] = 'r1.jpg'
theImages[2] = 'r2.jpg'
theImages[3] = 'r3.jpg'
theImages[4] = 'r4.jpg'
theImages[5] = 'r5.jpg'
theImages[6] = 'r6.jpg'
theImages[7] = 'r7.jpg'
theImages[8] = 'r8.jpg'
theImages[9] = 'r9.jpg'
theImages[10] = 'r10.jpg'
theImages[11] = 'r11.jpg'
theImages[12] = 'r12.jpg'
theImages[13] = 'r13.jpg'
theImages[14] = 'r14.jpg'
theImages[15] = 'r15.jpg'
theImages[16] = 'r16.jpg'
theImages[17] = 'r17.jpg'
theImages[18] = 'r18.jpg'
theImages[19] = 'r19.jpg'
theImages[20] = 'r20.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="images/'+theImages[whichImage]+'">');
}

