var theImages = new Array()

//Random-loading images
theImages[0] = 'images/title0.jpg' // replace with names of images
theImages[1] = 'images/title1.jpg' // replace with names of images
theImages[2] = 'images/title2.jpg' // replace with names of images

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]+'" border=0 width=800>');
}

function menuOver(item) {
	item.className = item.className + 'Over';
}

function menuOut(item) {
	item.className = item.className.substring(0, item.className.length-4);
}

function navigate(url) {
	document.location = url;
}

var oldItem;
var lastOpen;

function show(id) {
	
	var item = document.getElementById(id+"Item");

	if (oldItem) {
		oldItem.onmouseout = function() {this.className="item";}
		oldItem.onmouseover = function() {this.className="itemOver";}
		oldItem.className = "item";		
	}
	
	item.className = "itemSelected";
	item.onmouseout = function(){};
	item.onmouseover = function(){};
		
	oldItem = item;

	if (lastOpen) {
		lastOpen.style.display = "none";
	}
	var content = document.getElementById(id);
	content.style.display = "inline";
	lastOpen = content;
}

