function body_onload() {
	attach_menu_mouse();
}

function attach_menu_mouse() {
	var ultags=document.getElementById('hd-menu').getElementsByTagName('ul')
	for (var i = 0; i < ultags.length; i++){
		ultags[i].parentNode.id = Math.random() * Math.pow(10, 17);
		ultags[i].parentNode.onmouseover = function() { menu_mouseover(this); }
		ultags[i].parentNode.onmouseout = function() { menu_mouseout(this); }
	}
}

var timers = new Timers();
function Timers() {
	this.Set = TimersSet;
	this.Get = TimersGet;
}
function TimersSet() {
	this[arguments[0]] = arguments[1];
}
function TimersGet() {
	return this[arguments[0]];
}

function menu_mouseover(el) {
	el.getElementsByTagName('ul')[0].style.display = 'block';
	clearTimeout(timers.Get(el.id));
}
function menu_mouseout(el) {
	timers.Set(el.id,setTimeout(function() { el.getElementsByTagName('ul')[0].style.display = 'none'; },500));
}

