//dynamic top navigation
var this_page_text="";
var this_page_byid="";
initNav = function() {
	var navRoot = document.getElementById("navigation");
	
	
	var lis = navRoot.getElementsByTagName("li");
	var ignore_hover=0;
	for (var i=0; i<lis.length; i++)
	{
		ignore_hover=0;
		if (this_page_text || this_page_byid){
			var aas = lis[i].getElementsByTagName("a");
			for (var j=0; j<aas.length; j++)
			{
				if ((!this_page_byid && aas[j].text==this_page_text) || this_page_byid==aas[j].id){
					aas[j].className+=" chosen";
					ignore_hover=1;
				}
				

			}
		}
		
		var subItem = lis[i].getElementsByTagName("ul")[0];
		if (subItem)
		{
			subItem.style.width = (lis[i].offsetWidth -5) + "px";
		}
		if (ignore_hover!=1){
			lis[i].onmouseover = function()
			{
				this.className += " hover";
			}
			lis[i].onmouseout = function()
			{
				this.className = this.className.replace("hover", "");
			}
		}else {
			lis[i].className += " hover";
		}
	}
}
if (window.addEventListener)
	window.addEventListener("load", initNav, false);
else if (window.attachEvent && !window.opera)
	window.attachEvent("onload", initNav);
