var aitem, atimer;
function menuItemShow(){
	if (atimer) clearTimeout(atimer);
	this.childNodes[this.nod].style.visibility = "visible";
}
function menuItemHide(){
	this.childNodes[this.nod].style.visibility = "hidden";
}
function menuItemOut(ev){
      atimer = setTimeout("window.aitem.hide();", 200);
      //this.hide();
}
function menuItemOver(ev){
      if(aitem) if(aitem!=this) aitem.hide();
      this.show();
      aitem = this;
}
function xinit(menu_id) {
	var menu = document.getElementById(menu_id);
	for(var i=0;i<menu.childNodes.length;i++){
		it=menu.childNodes[i];
		if (it.className == 'closed' ){
        for(var j=0;j<it.childNodes.length;j++){
          sub = it.childNodes[j];
          if(sub.className == 'msubmenu'){
              it.show = menuItemShow;
              it.hide = menuItemHide;
              it.nod = j;
              it.onmouseover = menuItemOver;
              it.onmouseout = menuItemOut;
          }
        }
		}
	}
}
