//------------------------------------------------------------------------------
// MENU
var menutimer;
var wait = 200;
//var rootID = 0;
//var rootID = 1000;
//------------------------------------------------------------------------------
function init() {
    document.body.onclick = hideAll;
    menudiv.onmouseout = clearTimer;
}
//------------------------------------------------------------------------------
function showHMenu(menuID, childID) {
    menutimer = setTimeout("showMenu(" + menuID + ", " + childID + ")", wait);
}
//------------------------------------------------------------------------------
function showMenu(menuID, childID) {
    hideMenu(menuID);
    if (childID!=null) {
        var oObject = eval("layer_" + childID);
        oObject.style.visibility = "visible";
    }
}
//------------------------------------------------------------------------------
function hideMenu(menuID) {
    if (menuID!=null) {
        var oMenu = eval("layer_" + menuID);
        var oObject = oMenu.all.tags("table");
        if (oObject != null && oObject.length != null) {
            for (i = 0; i < oObject.length; i++) {
                oObject(i).style.visibility = "hidden";
            }
        }
    }
}
//------------------------------------------------------------------------------
function hideAll() {
    hideMenu(rootID);
}
//------------------------------------------------------------------------------
function clearTimer() {
    clearTimeout(menutimer);
}
//------------------------------------------------------------------------------
// TREE
function doit(menuID) {
	var obj = eval("tree_" + menuID);
	obj.style.display="none";
}
//------------------------------------------------------------------------------
// COMMON
function displayWindow(url, width, height) {
  var top = screen.height/2 - height/2;
  var left = screen.width/2 - width/2;
  window.open(url, 'myWin', 'top=' + top + ', left=' + left + ', width=' + width + ', height=' + height + ', resizable=0, scrollbars=1, menubar=0, status=0' );
}
//------------------------------------------------------------------------------
function openWin(url,width,height,name) {
  var top = screen.height/2 - height/2;
  var left = screen.width/2 - width/2;
  window.open(url, name, 'top=' + top + ', left=' + left + ', width=' + width + ', height=' + height + ', resizable=1, scrollbars=0, menubar=0, status=0' );
}
//------------------------------------------------------------------------------
function openWin2(url,width,height,name) 
{
  var top = screen.height/2 - height/2;
  var left = screen.width/2 - width/2;
  window.open(url, name, 'top=' + top + ', left=' + left + ', width=' + width + ', height=' + height + ', resizable=0, scrollbars=0, menubar=0, status=0' );
}
//------------------------------------------------------------------------------
function openWinScroll(url,width,height,name) 
{
  var top = screen.height/2 - height/2;
  var left = screen.width/2 - width/2;
  window.open(url, name, 'top=' + top + ', left=' + left + ', width=' + width + ', height=' + height + ', resizable=1, scrollbars=1, menubar=0, status=0' );
}
//------------------------------------------------------------------------------