    var shown = '', tm_id = 0;

	function init(id)
	{
		var m1 = document.getElementById(id);
		m1.onmouseover = function(e) { mover(id); }
		m1.onmouseout = function(e) { mout(id); }

		if (document.getElementById("sub_"+id))
		{
			var m2 = document.getElementById("sub_"+id);

			for (var i = 0; i < m2.childNodes.length; i ++)
			{
				if (m2.childNodes[i].tagName == 'LI')
				{
					m2.childNodes[i].onmouseover = function(e) { mover(id); this.style.backgroundColor = '#e64614'; }
					m2.childNodes[i].onmouseout = function(e) { this.style.backgroundColor = '#787878'; }
				}
			}
		}
	}
	function mout(id) { tm_id = setTimeout("hide('"+id+"')", 200); }
	function mover(id) { show(id); }
	function show(id) {
		if (shown != '' && shown != id) hide(shown);
		if (tm_id != 0 && shown == id) { clearTimeout(tm_id); tm_id = 0; }
		var m1 = document.getElementById(id);
		if (m1.className != 'static-item') m1.className = 'over';
		if (document.getElementById("sub_"+id))
		{
			var m2 = document.getElementById("sub_"+id);
			m2.style.left = m1.offsetLeft + 'px';
			m2.style.display = 'block';
			if (m1.offsetWidth > m2.offsetWidth) m2.style.width = m1.offsetWidth + 'px';
		}
		shown = id;
	}
	function hide(id) {
		if (shown == id) shown = '';
		var m1 = document.getElementById(id);
		if (m1.className != 'static-item') m1.className = 'out';
		if (document.getElementById("sub_"+id))
		{
			var m2 = document.getElementById("sub_"+id);
			m2.style.display = 'none';
		}
	}
	document.getElementById("submenu").onmouseout = function(e) { if (shown) { mout(shown); } }

	var m0 = document.getElementById("menu_ul");

	for (var i = 0; i < m0.childNodes.length; i ++)
	{
		if (m0.childNodes[i].tagName == 'LI')
		{
			init(m0.childNodes[i].id);
		}
	}