/*
    news.js
    Creates a drop down affect when a link is clicked.
    Like an expanding information area.
    ---------------------------------
    Brett Horan      22/11/2005
    Simon Holywell   23/11/2005
      -> Added code to close un-used
         drop downs so only one is
         open at a time.
    ---------------------------------
    Usage:
    <h4><a href="" onclick="return toggleProcedure('1')" onfocus="this.blur()"><img src="images/expand.gif" id="expander1" class="expander">Title</a></h4>
    <div style="display: none;" class="procedure" id="procedure1">
      <p>Body content of the drop down section.</p>
    </div>
*/
var dirpath = "/themes/go4/images/";
function toggleProcedure(currProcedure) {
		var counter = 1;
		while(document.getElementById("procedure"+counter)){
		    document.getElementById("procedure"+counter).style.display = "none";
			document.getElementById("expander"+counter).src = dirpath+"expand.gif";
		    counter++;
		}
		var thisProcedure = document.getElementById("procedure"+currProcedure).style;
		var thisExpander = document.getElementById("expander"+currProcedure);
		if (thisProcedure.display == "block") {
			thisProcedure.display = "none";
			thisExpander.src = dirpath+"expand.gif";
		}
		else {
			thisProcedure.display = "block";
			thisExpander.src = dirpath+"collapse.gif";
		}
}