function ShowElement(element,button,buttonon,buttonoff,elementlist,hideothers,buttonlist){ 
// Script Author: Mark Rossmore
// Shows and hides whichever element is displayed
// Changes the status control button for the element
// Fields:
// 		ELEMENT: The name of the actual document element that needs to be hidden/shown.
// 		BUTTON: The name of the element's control button (usually a plus-sign or minus-sign graphic that points to this function).
// 		BUTTONON: The button graphic that shows when the element is visible. In most cases this will be a "Minus-sign" to show that it can be shrunk.
// 		BUTTONOFF: The button graphic that shows when the element is NOT visible. In most cases this will be a "Plus-sign" to show that it can be opened.
// 		ELEMENTLIST: An array of all comparable elements that forms the basis for the HIDEOTHERS function
// 		HIDEOTHERS: If set to TRUE, this will run off the array called <elementlist> (this is created elsewhere) and hide all other elements in that array except for the one named here in the "ELEMENT" variable.

	// Check if element is not empty
		if (element != "") {
			// Determine current visibility status
			elementstate = document.getElementById(element).style;
			if (elementstate.display == "block") {
				elementstate.visibility = "hidden";
				elementstate.display = "none";
			} else {
				elementstate.visibility = "visible";
				elementstate.display = "block";
			}
			
		}
	// Check if button is not empty
		if (button != "") {
			// Determine current visibility status
			thisButton = document.getElementById (button)
			if (elementstate.display == "block") {
				// Show "Off" button
				thisButton.src=buttonoff;
			} else {
				// Show "On" button			
				thisButton.src=buttonon;
			}
			for (x = 0; x < buttonlist.length; x++) {
				if (elementlist[x] != element) {
					document.getElementById(buttonlist[x]).src = buttonoff;
				} else {
					document.getElementById(buttonlist[x]).src = buttonon;	
					
				}
			}			
			
		}		

	// Hide other elements?
	// NOTE: <elementlist> variable is REQUIRED for this function to be set to TRUE
		if (hideothers == true) {
			// If TRUE, loop through element list and hide all that are not this ELEMENT
			for (x = 0; x < elementlist.length; x++) {
				if (elementlist[x] != element) {
				document.getElementById(elementlist[x]).style.visibility = "hidden";
				document.getElementById(elementlist[x]).style.display = "none";				

				}
			}
		}
		
// End ShowElement function		
}
	
