// JavaScript Document

var theImages = new Array()

theImages[0] = 'images/pics/img_01.jpg'
theImages[1] = 'images/pics/img_02.jpg'
theImages[2] = 'images/pics/img_03.jpg'
theImages[3] = 'images/pics/img_04.jpg'
theImages[4] = 'images/pics/img_05.jpg'
theImages[5] = 'images/pics/img_06.jpg'
theImages[6] = 'images/pics/img_07.jpg'
theImages[7] = 'images/pics/img_08.jpg'
theImages[8] = 'images/pics/img_09.jpg'
theImages[9] = 'images/pics/img_10.jpg'
theImages[10] = 'images/pics/img_11.jpg'
theImages[11] = 'images/pics/img_12.jpg'
theImages[12] = 'images/pics/img_13.jpg'
theImages[13] = 'images/pics/img_14.jpg'
theImages[14] = 'images/pics/img_15.jpg'
theImages[15] = 'images/pics/img_16.jpg'
theImages[16] = 'images/pics/img_17.jpg'

function showImage(num)
{
	var level = num;
	var p = theImages.length;
	var preBuffer = new Array()
	var whichImage = Math.round(Math.random()*(p-1));
	
	for (i = 0; i < p; i++)
	{
   		preBuffer[i] = new Image()
   		preBuffer[i].src = theImages[i]
	}
	switch (level)
	{
		case "level_1":
		document.write('<img src="'+theImages[whichImage]+'" width="201" height="205" alt="image of king and I thai" style="float:left; margin-right:20px;">');
		break;
		
		case "level_2":
		document.write(	'<img src="../'+theImages[whichImage]+'" width="201" height="205" alt="image of king and I thai" style="float:left; margin-right:20px;">');
		break;
	}
}
