var theImages = new Array()


theImages[0] = 'js/church_1.jpg'
theImages[1] = 'js/church_2.jpg'
theImages[2] = 'js/church_3.jpg'
theImages[3] = 'js/church_4.jpg'
theImages[4] = 'js/church_5.jpg'
theImages[5] = 'js/church_6.jpg'
theImages[6] = 'js/church_7.jpg'
theImages[7] = 'js/church_8.jpg'
theImages[8] = 'js/church_9.jpg'
theImages[9] = 'js/church_10.jpg'
theImages[10] = 'js/church_11.jpg'
theImages[11] = 'js/church_12.jpg'
theImages[12] = 'js/church_13.jpg'
theImages[13] = 'js/church_14.jpg'
theImages[14] = 'js/church_15.jpg'
theImages[15] = 'js/church_16.jpg'
theImages[16] = 'js/church_17.jpg'
theImages[17] = 'js/church_18.jpg'
theImages[18] = 'js/church_19.jpg'
theImages[19] = 'js/church_20.jpg'
theImages[20] = 'js/church_21.jpg'
theImages[21] = 'js/church_22.jpg'
theImages[22] = 'js/church_23.jpg'
theImages[23] = 'js/church_24.jpg'
theImages[24] = 'js/church_25.jpg'
theImages[25] = 'js/church_26.jpg'
theImages[26] = 'js/church_27.jpg'
theImages[27] = 'js/church_28.jpg'
theImages[28] = 'js/church_29.jpg'
theImages[29] = 'js/church_30.jpg'
theImages[30] = 'js/church_31.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]+'">');
}

showImage();

