function $(v) { return(document.getElementById(v)); }
function $S(v) { return($(v).style); }

var curr;

function mouseover(i) {
	if (curr != i) if ($('sub_'+curr)) $S('sub_'+curr).display = 'none';
	curr = i;
	if ($('nav_'+i)) $('nav_'+i).className = 'btn_o';
	if ($('sub_'+i)) $S('sub_'+i).display = 'block';
}

function mouseout(i) {
	if ($('nav_'+i)) $('nav_'+i).className = 'btn';
}

nhover = function() {
	var fls = document.getElementById("nav").getElementsByTagName("ul");
	for (var i=0; i<fls.length; i++) {
		fls[i].parentNode.onmouseover= function() {
			this.lastChild.className+=" xhover";
		}
		fls[i].parentNode.onmouseout=function() {
			this.lastChild.className=this.lastChild.className.replace(new RegExp(" xhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", nhover);
