//Toggle display of equipment
function seeList(name) {

	//if user wants info on GSC props
	if (name == "specs") {
		document.getElementById("instruments").style.display = "none";
		document.getElementById("equipment").style.display = "none";
		document.getElementById(name).style.display = "block";
		return;
	}

	if (name == "instruments") {
		document.getElementById("specs").style.display = "none";
		document.getElementById("equipment").style.display = "none";
		document.getElementById("instruments").style.display = "block";
		return;
	}
	
	if (name == "equipment") {
		document.getElementById("specs").style.display = "none";
		document.getElementById("instruments").style.display = "none";
		document.getElementById("equipment").style.display = "block";
		return;
		
	}
	
}


// ************ BEGIN RANDOM PICTURE CODE **********************

/* Insert path/filenames and title text in the following array
   pix must not exceed 300px in width

Model:
"path/filename,title text",

 */

var pixBank = new Array(

"gallery/images/aussen_12_800.jpg,S-Wing",
"gallery/images/aussen_13_800.jpg,S-Wing",
"gallery/images/aussen_15_800.jpg,S-Wing",
"gallery/images/aussen_22_800.jpg,S-Wing",
"gallery/images/aussen_24_800.jpg,S-Wing",

//IMPORTANT!! The last item in the array must NOT end with a comma!
"gallery/images/aussen_25_800.jpg,S-Wing"
);

//creates Graphic entity with properties of a filename (src) and caption (title text)
function Graphic(file, caption) {

	this.file = file;
	this.caption = caption;

}

//create new array called imgs
var imgs = new Array();

//for each picture file in the database
for (i=0; i<pixBank.length; i++) {

	//temporarily split it and store in array "mw"	
	var mw = pixBank[i].split(",");

	//convert temporary array into a Graphic entity and load into array 'imgs'
	imgs[imgs.length] = new Graphic(mw[0].toString(), mw[1].toString());

	//clear temporary array, then repeat until done
	mw = "";

}

//changes display to next random pictures
function chgTitle(obj) {

//get a random number
var pRef = getRand();

//reset the src and title attributes of the image element contained in variable obj
//to one in the pixBank array
document.getElementById(obj).src=imgs[pRef].file;
document.getElementById(obj).title=imgs[pRef].caption;

}

//Generate a random number between 0 and the total number of pictures in the database
function getRand() {
	var randomNum = 100;
	while (randomNum >= pixBank.length) {
		randomNum = Math.random() * pixBank.length;
		randomNum = Math.round(randomNum);
	}
	return randomNum;
}

var ken = setInterval('chgTitle("rndPic")', 5000);

// ************ END RANDOM PICTURE CODE **********************

