// Work-around for Netscape
if (!document.all) 
{
    if (document.getElementsByTagName("*")) {
        document.all = document.getElementsByTagName("*")
    }
}

var menuToHide = null;
var menuShowing = null;
var ltimeout;

function showMenu(c, m)
{
    if (document.all[m])
    {
        hideIt();
        menuToHide = null;
            
        var table=document.all['table'];
        var row=document.all['row'];
        var cell=document.all[c];
        menuShowing=document.all[m];

        menuShowing.style.left = cell.offsetLeft + 10;
        menuShowing.style.top = parseInt(row.height) + parseInt(table.offsetTop) + 1;
        menuShowing.style.visibility="visible";
        menuShowing.style.display = "inline";
    }
}
 
function showMenuRight(c, m)
{
    if (document.all[m])
    {
        hideIt();
        menuToHide = null;
            
        var table=document.all['table'];
        var row=document.all['row'];
        var cell=document.all[c];
        menuShowing=document.all[m];

        menuShowing.style.left = cell.offsetLeft -90;
        menuShowing.style.top = parseInt(row.height) + parseInt(table.offsetTop) + 1;
        menuShowing.style.visibility="visible";
        menuShowing.style.display = "inline";
    }
}

function hideMenu(m)
{
    if (document.all[m])
    {
        menuToHide = document.all[m];
        ltimeout = setTimeout('hideIt()', 500);
    }
}

function hideIt()
{
    if (menuToHide != null)
    {
        menuToHide.style.visibility="hidden";
        menuShowing.style.display = "";  //???
	}
    clearTimeout(ltimeout);
}

function highlight(d,anc)
{
    menuToHide = null;
    d.style.background="#ffffff";
    document.all[anc].style.color="#000000";
}

function clearMenuToHide()
{
    menuToHide = null;
}

function mimo(d,anc)
{
    d.style.background="#445d93";
    document.all[anc].style.color="#ffffff";
    menuToHide = menuShowing;
    ltimeout = setTimeout('hideIt()', 500);
}

function menuExit()
{
    menuToHide = menuShowing;
    ltimeout = setTimeout('hideIt()', 500);
}
