var menu2_expand_stack   = new Array();
var menu2_expand_count   = 0;
var menu2_expand_timeout = null;

function menu2_expand_mouseover(objectid,
                                parentid,
                                trigger)
{
        clearTimeout(menu2_expand_timeout);
        var _object = document.getElementById(objectid);
        while (menu2_expand_count > 0)
        {
                if (menu2_expand_stack[menu2_expand_count][0] == parentid) break;
                fx_visible(menu2_expand_stack[menu2_expand_count][0], false);
                fx_move(menu2_expand_stack[menu2_expand_count--][0], 0, 0);
        };
        var parent  = trigger.offsetParent;
        var x1      = trigger.offsetLeft + parent.offsetLeft;
        var y1      = trigger.offsetTop  + parent.offsetTop;
        if (menu2_expand_mouseover.arguments.length > 3) y1 += fx_height(trigger);
        else                                             x1 += fx_width(trigger);
        fx_move(_object, x1, y1);
        x1          = fx_left(_object);
        y1          = fx_top(_object);
        var x2      = x1 + fx_width(_object);
        var y2      = y1 + fx_height(_object);
        menu2_expand_stack[++menu2_expand_count] = new Array(objectid, x1, y1, x2, y2);
        fx_visible(_object, true);
        menu2_expand_timeout = null;
};
//................................
function menu2_expand_mouseout()
{
        if (menu2_expand_count > 0)
        {
                menu2_expand_stack[menu2_expand_count][5] = true;
                if (! menu2_expand_timeout) menu2_expand_timeout = setTimeout("_menu2_expand_mouseout();", 1500);
        };
};
//................................
function _menu2_expand_mouseout()
{
        for (var i = menu2_expand_count; i > 0; i--)
        {
                if (
                     (fx_mouse_x < menu2_expand_stack[i][1])
                     ||
                     (fx_mouse_x > menu2_expand_stack[i][3])
                     ||
                     (fx_mouse_y < menu2_expand_stack[i][2])
                     ||
                     (fx_mouse_y > menu2_expand_stack[i][4])
                   )
                {
                        if (menu2_expand_stack[i][5])
                        {
                                fx_visible(menu2_expand_stack[menu2_expand_count][0], false);
                                fx_move(menu2_expand_stack[menu2_expand_count--][0], 0, 0);
                        };
                        continue;
                };
                break;
        };
        menu2_expand_timeout = null;
};
//................................
function menu2_expand_mousemove(event)
{
        if (
             (menu2_expand_count > 0)
             &&
             (! menu2_expand_timeout)
             &&
             (event == "mousemove")
           )
                menu2_expand_timeout = setTimeout("_menu2_expand_mouseout();", 1500);
};
fx_register_callback(menu2_expand_mousemove);