/**
 * Event handler for displaying or not expand list
 * the table and the div should have an id called "divExpandingBox"+id or "tableExpandingBox"+id, where id is the parameter of this method
 */
 
function clickExpandingGroup(id, expandFunc, closeFunc) {
	var theDivExpGrp = document.getElementById("divExpandingBox"+id);
	var theHeaderExpGrp = document.getElementById("headerExpandingBox"+id);
	
	if (theDivExpGrp.style.display=="")
	{
		theDivExpGrp.style.display="none";
		// remove Expand
        var clsName = theHeaderExpGrp.className;
        var idx = clsName.indexOf("Expanded");
        if (idx != -1) {
            theHeaderExpGrp.className = clsName.substr(0,idx-1) + clsName.substr(idx+8, clsName.length-1);
        }
        if (closeFunc) {
        	var func = eval(closeFunc);
        	func(id);
        }
	}
	else
	{
		theHeaderExpGrp.className += " Expanded";
		theDivExpGrp.style.display="";
		if (expandFunc) {
        	var func = eval(expandFunc);
        	func(id);
        }
	}
} 

function isExpanded(id) {
	var theDivExpGrp = document.getElementById("divExpandingBox"+id);
	return (theDivExpGrp.style.display != "none");
}


