function initMenu() {
	var _menu = document.getElementById("menu");
	if(_menu) {
		var nodes = _menu.getElementsByTagName("li");
		var lastLi;
		var lastLi, prevLi;
		for (var i=0; i<nodes.length; i++) {
			if(nodes[i].className.search('m-') > -1){				
				prevLi = lastLi;
				lastLi = nodes[i];
			}
			var _box = nodes[i].getElementsByTagName('div')[0];
			if(_box){
				var t_l = _box.getElementsByTagName('span');
				for(var j = 0; j < t_l.length; j++) {
					if(t_l[j].className.indexOf('l-bg') != -1 && t_l[j].parentNode == _box) {
						t_l[j].style.height = _box.offsetHeight - 2 + 'px';
					}
				}
				nodes[i].onmouseover = function() { this.className += ' hover ';}
				nodes[i].onmouseout = function() { this.className = this.className.replace('hover', '');}
			}
		}

		prevLi.className += ' last';
                var divList = prevLi.getElementsByTagName("div");
		var div = divList[0];
		var ulList = div.getElementsByTagName("ul");
		var ul = ulList[0];               
		ul.className += ' last';
		lastLi.className += ' last';
		
		
	}
}
if (window.addEventListener){
	window.addEventListener("load", initMenu, false);
}
else if (window.attachEvent){
	window.attachEvent("onload", initMenu);
}
