
var aitem, atimer;

function menuItemShow(){
	if (atimer) clearTimeout(atimer);
	//alert(this);
	this.className = "sel";
}

function menuItemHide(){
	this.className = "";
	//getE('origcat').style.display = 'inline';
}

function menuItemOut(ev){
	atimer = setTimeout("window.aitem.hide();", 100);
}

function menuItemOver(ev){
	if(aitem) if(aitem!=this) aitem.hide();
	this.show();
	aitem = this;
	//getE('origcat').style.display = 'none';
}

function xinit(menu_id) {
	var menu = document.getElementById(menu_id);
	for(var i=0;i<menu.childNodes.length;i++){
		it=menu.childNodes[i];
		it.show = menuItemShow;
		it.hide = menuItemHide;
		it.onmouseover = menuItemOver;
		it.onmouseout = menuItemOut;
	}
}

function xmenu_init() {
	xinit('xmenu');
}
