function initMenu()
{
	var nodes = document.getElementById("navigation").getElementsByTagName("li");
	for (var i=0; i<nodes.length; i++)
	{
		nodes[i].onmouseover = function()
		{
			this.className += " hover";
		}
		nodes[i].onmouseout = function()
		{
			this.className = this.className.replace(" hover", "");
		}
	}
}
if (document.all && !window.opera) attachEvent("onload", initMenu);

var _maxWidth = 0;
function navWidth(){
	var _menu = document.getElementById("navigation");
	if (_menu){
		var _uls = _menu.getElementsByTagName("ul");
		for (var k = 0; k < _uls.length; k++) {
			_maxWidth = 0;
			var _a = _uls[k].getElementsByTagName("span");
			for (var i = 0; i < _a.length; i++) {
				if (_maxWidth<_a[i].offsetWidth)
				_maxWidth = _a[i].offsetWidth;
				_a[i].parentNode.parentNode.parentNode.style.width = _maxWidth + 30 +"px";
			}
			if (_maxWidth+30 < _a[0].parentNode.parentNode.parentNode.parentNode.offsetWidth)
				_a[0].parentNode.parentNode.parentNode.style.width = _a[0].parentNode.parentNode.parentNode.parentNode.offsetWidth - 20 + 'px';
			_uls[k].style.visibility = 'visible';
			_uls[k].style.display = 'none';
		}		
	}
}
if (window.addEventListener)
	window.addEventListener("load", navWidth, false);
else if (window.attachEvent)
	window.attachEvent("onload", navWidth);