sfHover = function() {
	if (!document.getElementById("nav_1")) {return false;}
	var sfEls = document.getElementById("nav_1").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 addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}



function TrimString(sInString) {
  sInString = sInString.replace( /^\s+/g, "" );// strip leading
  return sInString.replace( /\s+$/g, "" );// strip trailing
}
	
function traceerLI(p)
	{
	var str="nav_1_"+String(p);
	var d=document.getElementById(str);
	
	if (d)
		{
		if(d.nodeName=="LI" && d.parentNode.nodeName=="UL" && d.parentNode.id=="nav_1") //item is hoofd-item, zoek naar beneden
			{	
			return d;
			}
		else
			{
			if(d.nodeName=="LI" && d.parentNode.nodeName=="UL") //item is sub-item, zoek omhoog
				{
				if(d.parentNode.parentNode && d.parentNode.parentNode.nodeName=="LI")
					{
					return d.parentNode.parentNode;
					}
				}
			}	
		}
	else {return false;}
	}
	
function openHoofdmenu(p)
	{
	var str="nav_1_"+String(p);
	var s=k=document.getElementById(str);
	if (k) {k.className="activeItem";}
	var d=traceerLI(p);
	if (d==false || d==undefined) {return false;}
	d.className="activeItem";

	if(d.childNodes.length>0)
		{	
		//spoor child UL op
		if(d.childNodes.length>1 && d.childNodes[1].nodeName=="UL")
			{
			d.childNodes[1].style.display="block";
			}
		 
		}
	}


