<!--

// kPanelImageNumber - the number of the LCD panel in the image
// array for the current page.

kPanelImageNumber = 0;

// canManipulateImages - check if the browser we're using can do
// clever stuff with document images. So far, only NetScape (Mozilla)
// v3.0 or better has this capability. This might be better implemented
// by simply specifying the script language as JavaScript 1.1, but
// we'll leave that for the time being.

function canManipulateImages() {
	if (document.images)
		return true;
	else
		return false;
}

// preLoadImage - pre-create and pre-load an image so that it's ready
// when we want to use it.

function preLoadImage(imageURL) {
	if (gImageCapableBrowser) {
		image = new Image();
		image.src = imageURL;
		return image;
	}
}

// updateButton - update both the LCD panel image and the button
// image. We actually pass in a 'result' value to let the function
// know if it should return true or false. Pass 'false' if you
// want the browser to update the status line, 'true' if you want
// the browser to actually do something (i.e. handle a click).

function updateButton(panelMessageName,buttonName,buttonState,result) {
	if (gImageCapableBrowser) {
		var panelImage = eval("imagePanel" + panelMessageName);
		var buttonImage = eval("button" + buttonName + buttonState);
		document ["lcdPanel"].src = panelImage.src;
		document ["button" + buttonName].src = buttonImage.src;
	}
	return result;
}

// gImageCapableBrowser - is this browser hip to images? Set up
// a global variable so that we don't have to keep calling a function
// (useful if the function becomes costly to compute).

gImageCapableBrowser = canManipulateImages();

// Set up all the alternative LCD panels we intend to use.

imagePanelBlank = preLoadImage("../images/imagePanelBlank.gif");
imagePanelOne = preLoadImage("../images/imagePanelOne.gif");
imagePanelTwo = preLoadImage("../images/imagePanelTwo.gif");
imagePanelThree = preLoadImage("../images/imagePanelThree.gif");
imagePanelFour = preLoadImage("../images/imagePanelFour.gif");
imagePanelFive = preLoadImage("../images/imagePanelFive.gif");

// And the buttons

buttonOneInactive = preLoadImage("../images/buttonOneI.jpg");
buttonOneActive = preLoadImage("../images/buttonOneA.jpg");
buttonTwoInactive = preLoadImage("../images/buttonTwoI.jpg");
buttonTwoActive = preLoadImage("../images/buttonTwoA.jpg");
buttonThreeInactive = preLoadImage("../images/buttonThreeI.jpg");
buttonThreeActive = preLoadImage("../images/buttonThreeA.jpg");
buttonFourInactive = preLoadImage("../images/buttonFourI.jpg");
buttonFourActive = preLoadImage("../images/buttonFourA.jpg");
buttonFiveInactive = preLoadImage("../images/buttonFiveI.jpg");
buttonFiveActive = preLoadImage("../images/buttonFiveA.jpg");

// -->