// author:	Guy Murphy
// date:	28th April 2005
// purpose:	toggle specified section style and button image
// history:	fixed to work x-browser
// notes:	specific to Pal Mar.... I think

// a function to get the last filename part of a url
function getImageName (imageSource) {
	var parts = imageSource.split('/');
	name = parts[parts.length-1];
	return name;
}

// a function to swap the image of a button and an elements class
// back and forth
function toggleInfoSection (buttonElement, sectionId) {
	var element = document.getElementById(sectionId); // the element being acted upon
	// [1] toggle the display style property of the element being acted upon
	element.style.display = (element.style.display == 'none') ? 'block' : 'none';
	// [2] figure out what the button needs to become
	var source = (getImageName(buttonElement.getAttribute("src")) == "button.gif") ? "images/button-hide.gif" : "images/button.gif";
	// [3] set the new source of the button
	buttonElement.setAttribute("src",source);
}