function makeCollapsible(listElement, controlEl)
{
listElement	= listElement.getElementsByTagName("ul")[0];

// loop over all child elements of the list
var child	= listElement.firstChild;
while (child!=null)
{

// only process li elements (and not text elements)
if (child.nodeType==1)
{

// build a list of child ol and ul elements and hide them
var list = new Array();
var grandchild = child.firstChild;

while (grandchild!=null)
{

if ((grandchild.tagName == "OL") || (grandchild.tagName == "UL"))
{
grandchild.style.display	= "none";

if (controlEl == "A")
{
child.getElementsByTagName(controlEl)[0].href		 	= "javascript:void('0')";
}

child.getElementsByTagName(controlEl)[0].className 		= "Closed";
list.push(grandchild);
}

grandchild=grandchild.nextSibling;
}

// add toggle buttons

if (child.getElementsByTagName(controlEl).length)
{
child.getElementsByTagName(controlEl)[0].onclick			= createToggleFunction(child.getElementsByTagName(controlEl)[0],list);
}

}

child=child.nextSibling;
}

}

function createToggleFunction(toggleElement,sublistElements)
{

return function()
{

if (toggleElement.className == "Closed")
{
toggleElement.className = "Open";
}

else
{
toggleElement.className	= "Closed";
}

// toggle display of sublists
for (var i=0;i<sublistElements.length;i++)
{
sublistElements[i].style.display = (sublistElements[i].style.display=="block")?"none":"block";
}

}

}