var strCurPanelId = "";

function Collapsible_Open(strId)
{
	document.getElementById(strId + "_Panel").className = "Collapsible_Panel_Open";
	document.getElementById(strId + "_Heading").className = "Collapsible_Heading_Open";
	document.getElementById(strId + "_Contents").className = "Collapsible_Contents_Open";
	strCurPanelId = strId;
}

function Collapsible_Close(strId)
{
	document.getElementById(strId + "_Panel").className = "Collapsible_Panel_Closed";
	document.getElementById(strId + "_Heading").className = "Collapsible_Heading_Closed";
	document.getElementById(strId + "_Contents").className = "Collapsible_Contents_Closed";
	strCurPanelId = "";
}



function Collapsible_StartContents(strId)
{
	document.write("<div id='" + strId + "_Contents' class='Collapsible_Contents_Closed'>");
}

function Collapsible_EndContents(strId)
{
	document.write("</div>");
}

function Collapsible_Init(strId, fInitiallyExpanded)
{
	if(fInitiallyExpanded)
		Collapsible_Open(strId);
	else
		Collapsible_Close(strId);
}

function Collapsible_Toggle(strId)
{
	var strPrevPanelId = strCurPanelId;
	
	if(strCurPanelId != "")
		Collapsible_Close(strCurPanelId);
		
	if(strId != strPrevPanelId)
		Collapsible_Open(strId);
}

