function menuClick(jid,depth)
{    
	var div = document.getElementById("menu_"+jid);
      var anchor = document.getElementById("button_"+jid);
      if (div.className == "collapse")
      {                   
      	div.className = "";

		//Only get anchors within the menu itself
		var anchors = document.getElementById('navigation').getElementsByTagName('a');

            for (var i =0;i< anchors.length;i++)
            {
		
            	var str = anchors[i].className;                
                  if (str.match(/depth([0-9]+)Selected/) && (parseInt(str.substring(5,str.length-1)) >= depth))
                  {                                                
                  	anchors[i].className = "menuItemDepth" + parseInt(str.substring(5,str.length-1));
                        var nextSib = anchors[i].nextSibling;
                        
                        if(nextSib != null)
                        if (nextSib.tagName == "DIV")
                        {
                            nextSib.className = "collapse";
                  	}                        
            	}            
            }                
      	anchor.className = "depth" + depth + "Selected";   
	}                 
}  

function loader()
{
	hightlightMenuItem();
}

function hightlightMenuItem()
{

	//Only get anchors within the menu itself
	var anchors = document.getElementById('navigation').getElementsByTagName('a');

	for (var i=0;i<anchors.length;i++)
	{
		if (window.location.toString() == anchors[i].toString() && anchors[i].className!='topMenu')
		{
			anchors[i].className = "depth1Selected";
		}
	}
}
      
document.write("<style type=\"text/css\">.collapse{display:none;}</style>");          

