var theImages = new Array() 

theImages[0] = 'images/room.jpg'
theImages[1] = 'images/room2.jpg'
theImages[2] = 'images/room3.jpg'
theImages[3] = 'images/room4.jpg'
theImages[4] = 'images/room7.jpg'
theImages[5] = 'images/room8.jpg'
theImages[6] = 'images/room9.jpg'
theImages[7] = 'images/room10.jpg'
theImages[8] = 'images/room11.jpg'
theImages[9] = 'images/room12.jpg'
theImages[10] = 'images/room13.jpg'
theImages[11] = 'images/room14.jpg'
theImages[12] = 'images/room15.jpg'
theImages[13] = 'images/room16.jpg'
theImages[14] = 'images/room17.jpg'
theImages[15] = 'images/room18.jpg'
theImages[16] = 'images/room19.jpg'
theImages[17] = 'images/room20.jpg'
theImages[18] = 'images/room21.jpg'
theImages[19] = 'images/room22.jpg'

// ======================================
// do not change anything below this line
// ======================================

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));

document.write('<img src="'+theImages[whichImage]+'">');
