// Function to 'deactivate' non-clicked button images.
function toggle(imgNumber) {
		for(var i =0; i < buttonNames.length; i++)
		{
			if (i != imgNumber) {
				document[buttonNames[i]].src =  path + buttonNames[i] + ".jpg";

			}
		}
}


// Function to 'activate' a button image when mouse goes inside image area
function buttonOn(imgNumber) {
        if (document.images) {

            document[buttonNames[imgNumber]].src =  eval(buttonNames[imgNumber] + "On.src");

        }
}

// Function to 'deactivate' a button image when mouse goes outside of image area.
function buttonOff(imgNumber) {


        if (document.images) {
			//determine if iframe html page name is same as button image.
			pagename = window.frames['iframe1'].location.href;   // don't use document.frames since it is not supported by firefox !
			myRegExp = /\w*\.htm/ 
			resultArray = pagename.match(myRegExp);
			for(var i =0; i < resultArray.length; i++)
			{
				if (resultArray[i] == buttonNames[imgNumber]  + ".htm") {
				   // keep "activated" button image displayed 
				   return;
				}
			}
			// show "deactivated" button image
			document[buttonNames[imgNumber] ].src = eval(buttonNames[imgNumber]  + ".src");

        }
}

