sfHover = function() {
	var sfEls = document.getElementById("topmenu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function domCollapse(which)
{
	if (document.getElementById && document.createTextNode)
	{
		if (which=="dispall")
		{
			domCollapseAll(1);
		}
		else if (which=="hideall")
		{
			domCollapseAll(0);
		}
		else
		{
			m=document.getElementById("menu");
			trig=m.getElementsByTagName("div").item(which).style.display;
			t=m.getElementsByTagName("h2").item(which);
			h=t.getElementsByTagName("a").item(0).firstChild;
			if (trig=="block") trig="none";
			else if (trig=="" || trig=="none") trig="block";
			if (trig=="none")
			{
				h.nodeValue=h.nodeValue.replace(highlighttext,normaltext);
				t.style.background=normalbackground;
				t.style.color=normalcolour;
			}
			else
			{
				h.nodeValue=h.nodeValue.replace(normaltext,highlighttext);
				t.style.background=highlightbackground;
				t.style.color=highlightcolour;
			}
			m.getElementsByTagName("div").item(which).style.display=trig;
		}
	}
}

/*
	function domCollapseAll(show)
	Written by Christian Heilmann
	- collapses or displays all <div></div> elements in the "menu" div of the document.
	- changes the colour and the background of all <p></p> elements in the "menu" div.
	- changes the text content of the <a></a> inside the <p></p> elements

	Variables:
	show:	0 > collapse all divs,set all colours to normal
			1 > show all divs,set all colours to highlight
*/
function domCollapseAll(show)
{
	if (document.getElementById && document.createTextNode)
	{
		m=document.getElementById("menu");
		for (i=0;i<m.getElementsByTagName("div").length;i++)
		{
			t=m.getElementsByTagName("h2").item(i);
			h=t.getElementsByTagName("a").item(0).firstChild;
			if (show==1)
			{
				h.nodeValue=h.nodeValue.replace(normaltext,highlighttext);
				t.style.background=highlightbackground;
				t.style.color=highlightcolour;
				m.getElementsByTagName("div").item(i).style.display="block";
			}
			else
			{
				h.nodeValue=h.nodeValue.replace(highlighttext,normaltext);
				t.style.background=normalbackground;
				t.style.color=normalcolour;
				m.getElementsByTagName("div").item(i).style.display="none";
			}
		}
	}
}

// Adding backwards compatibility
if (document.getElementById && document.createTextNode)
{
	document.write('<style type="text/css">#menu div{display:none;}</style>');


		highlightcolour="";
		highlightbackground="";
		highlighttext="-";

    	normalcolour="";
		normalbackground="";
		normaltext="+";
}
 //-->