/**
 * Show/Hide divs
 *
 * Note: The difference between using the css tags 'visibility' and 'block' is that with 'block' the layout will be updated.
 *
 * Added, image support - like Collective window shades
 * Assumes: Image assocciated with the div is named divID + IMG
 * So, if your div has an ID of: divID1 the associated IMG is divID1IMG
 *
 * Sample usage give at bottom of file
 */
 
var state = 'none';
// layer_ref
function showhide(divID) {

	var divIMG = document.getElementById(divID + "IMG")
	
	if (state == 'block') {
	state = 'none';
	}
	else {
	state = 'block';
	}
	
	if (document.all) { //IS IE 4 or 5 or 6
	eval( "document.all." + divID + ".style.display = state");
	}
	
	if (document.layers) { //IS NETSCAPE 4 or below
	document.layers[divID].display = state;
	}
	
	if (document.getElementById &&!document.all) {
	theDiv = document.getElementById(divID);
	theDiv.style.display = state;
	
	}
	
	if (divIMG != null)
		divIMG.src = (state == 'none') ? "resources/arrow_right.gif" : "resources/arrow_down.gif";
} 
/* EOF */

/**
 * Example usage in HTML document:
 *
 * Here is the "link" - we pass the id of the DIV to showhide
 * <a href="#" onclick="showhide('divID1');">Show/hide DIV 1</a>
 *
 * Here is a DIV to show or hide - be sure to set an "id" so we can pass it to showhide
 * Also, notice that we set display to none, so the div is hidden at page load, we could show at load if we set as block
 * <div id="divID1" style="display: none;">
 * <table>
 * <tr>Table in DIV 1</tr>
 * </table>
 *
 *
 * NEW Example, with nested divs with images - to act like Collective's windowshades...
 * <div id="testShade2" onclick="showhide('divID1')"><img id= "divID1IMG" src="resources/arrow_right.gif"> &nbsp;Gator Guys
 *	<div id="divID1" ondblclick="showhide('divID1')" style="background-color:#adba8c;display: none;">
 *		<table border=2 cellspacing=0 cellpadding=0>
 *			<tr><td>Table listing the Gator Guys</td></tr>
 *			<tr><td>Blah, blah blah</td></tr>
 *		</table>
 *	</div> 
 *</div>
 *
 * Notice, in the example above, if you double click on the open div it will close 
 */
