﻿// JavaScript
// Jfp 08-12-12
// 菜单操作

var showedMenu = null;
var timeOutMenu = null;
function showMenu(menuId,obj){ //显示菜单
	if(showedMenu){
		showedMenu.style.display = "none";
		showedMenu = null;
	}
	if(timeOutMenu){
		clearTimeout(timeOutMenu);
		timeOutMenu = null;
	}
	var menu = $("menuDiv_" + menuId);
	if(menu){
	    menu.style.left = getLeft(obj) + "px";
	    menu.style.top = getTop(obj) + obj.offsetHeight + "px";
	    menu.style.display = "block";
	    showedMenu = menu;
    	
	    obj.onmouseout = function () {timeOutMenu = setTimeout("hidMenu();",400)};
	    menu.onmouseover = function() {if(timeOutMenu){clearTimeout(timeOutMenu);timeOutMenu = null}};
	    menu.onmouseout = function () {timeOutMenu = setTimeout("hidMenu();",400)};
    }
}
function hidMenu() {  //隐藏菜单
	if(showedMenu){
		showedMenu.style.display = "none";
		showedMenu = null;
	}
}
