function makeCollapsible(listElement)
{
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";
child.getElementsByTagName("a")[0].href		 	= "#";
child.getElementsByTagName("a")[0].className 	= "Closed";
list.push(grandchild);
}

grandchild=grandchild.nextSibling;
}

// add toggle buttons
child.getElementsByTagName("a")[0].onclick		= createToggleFunction(child.getElementsByTagName("a")[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";
}

}

}