// General rollover script.

// Global variables.
var version = false;
var lastSelected = "";
var imgPath = "";
var button = new Array();

// Check if browser supports images.
if (document.images)
	version = true;

onerror = null;

//----------------------------------------------------------------//
// Initialize the buttons if the browser supports images.
//----------------------------------------------------------------//
function initButton(selImg, rollImg, normImg, help)
{
	if (version)
	{
		this.help = help;
		this.rollover = new Image();
		this.rollover.src = imgPath + rollImg;
		this.normal = new Image();
		this.normal.src = imgPath + normImg;
		this.selected = new Image();
		this.selected.src = imgPath + selImg;
	}
}

//----------------------------------------------------------------//
// For rollover buttons.
//----------------------------------------------------------------//
function rolloverButton(imageID)
{
	if( version )
	{
		if( document[imageID].src != button[imageID].selected.src )
		{
			document[imageID].src = button[imageID].rollover.src;			
			window.status = button[imageID].help;			
		}
	}
}

//----------------------------------------------------------------//
// For normal buttons.
//----------------------------------------------------------------//
function normalButton(imageID)
{
	if( version )
	{
		if( document[imageID].src != button[imageID].selected.src )
		{
			document[imageID].src = button[imageID].normal.src;
			window.status="";
		}
	}
} 

//----------------------------------------------------------------//
// For selected buttons.
//----------------------------------------------------------------//
function selectedButton(imageID)
{
	if( version )
	{
		window.status = "";
		if( lastSelected != "" )
			document[lastSelected].src = button[lastSelected].normal.src;
		document[imageID].src = button[imageID].selected.src;
		lastSelected = imageID;
	}
}