var foldingsections=new Array();

function initmenus()
{
	if (document.all&&document.getElementById)
	{
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function()
				{
					this.className+=" over";
					this.style.zIndex=200;
				}
				node.onmouseout=function()
				{
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

function activateeffects()
{
	var alldivs=document.getElementsByTagName("DIV");
	var thisdiv;
	var divcount=1;
	var thisfs;
	var i;
	
	for (i=0;i<alldivs.length;i++)
	{
		thisdiv=alldivs[i];
		if (thisdiv.className=="foldingsection") {
			thisdiv.id = "foldingsection"+divcount;

            thisfs = new fx.Height(thisdiv.id, {duration: 200});
            foldingsections[thisdiv.id]=thisfs;

            thisfs.hide();

			divcount++;
		}
	}
}

function togglefoldingsection(link)
{
	/* The nextSibling property is undefined on Firefox - so we'll do it the long way round */
	
	var pop=link.parentNode.parentNode;
	var copopop=pop.parentNode.childNodes;

	var nextSibling=null;
	var i;
	
	for (i=0;i<copopop.length;i++)
	{
		if (copopop[i]==pop) {
			/* The very next element is likely to be text, but may not be - check if it's a DIV */
			if (copopop[i+1].tagName != 'DIV') {
				i++;
			}
			foldingsections[copopop[i+1].id].toggle();
			return;
		}
	}
	
}

