var theImages = new Array() 


theImages[0] = 'images/header/1.jpg'
theImages[1] = 'images/header/2.jpg'
theImages[2] = 'images/header/3.jpg'
theImages[3] = 'images/header/4.jpg'
theImages[4] = 'images/header/5.jpg'
theImages[5] = 'images/header/6.jpg'
theImages[6] = 'images/header/7.jpg'
theImages[7] = 'images/header/8.jpg'
theImages[8] = 'images/header/9.jpg'
theImages[9] = 'images/header/10.jpg'
theImages[10] = 'images/header/11.jpg'
theImages[11] = 'images/header/12.jpg'
theImages[12] = 'images/header/13.jpg'
theImages[13] = 'images/header/14.jpg'
theImages[14] = 'images/header/15.jpg'
theImages[15] = 'images/header/16.jpg'
theImages[16] = 'images/header/17.jpg'
theImages[17] = 'images/header/18.jpg'
theImages[18] = 'images/header/19.jpg'
theImages[19] = 'images/header/20.jpg'
theImages[20] = 'images/header/21.jpg'
theImages[21] = 'images/header/22.jpg'
theImages[22] = 'images/header/23.jpg'
theImages[23] = 'images/header/24.jpg'
theImages[24] = 'images/header/25.jpg'
theImages[25] = 'images/header/26.jpg'
theImages[26] = 'images/header/27.jpg'
theImages[27] = 'images/header/28.jpg'
theImages[28] = 'images/header/29.jpg'
theImages[29] = 'images/header/30.jpg'
theImages[30] = 'images/header/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]+'">');
}