
            activeTD = null;
            activeMenu = null;

            document.onmousemove = updateMouse;
            if (g || l) captureEvents(Event.MOUSEMOVE);

            function checkMouseOver(x, y)
            {
                // Skip out if there is no active top menu item or the menu isn't showing
                if (!activeMenu || !activeTD) return;

                // See if mouse is over the main dropdown menu
                mouseInMenu = true;
                if (x < gX(activeMenu))                  mouseInMenu = false;
                if (x > gX(activeMenu) + gW(activeMenu)) mouseInMenu = false;
                if (y < gY(activeMenu))                  mouseInMenu = false;
                if (y > gY(activeMenu) + gH(activeMenu)) mouseInMenu = false;

                // See if mouse is over the top menu item
                mouseInTopMenu = true;
                if (x < gX(activeTD))                mouseInTopMenu = false;
                if (x > gX(activeTD) + gW(activeTD)) mouseInTopMenu = false;
                if (y < gY(activeTD))                mouseInTopMenu = false;
                if (y > gY(activeTD) + gH(activeTD)) mouseInTopMenu = false;

                // Turn menu off if it isn't in either
                if (!mouseInMenu && !mouseInTopMenu)
                {
                   out();
                }
            }

            function updateMouse(e)
            {
                mouseX = gMX(e);
                mouseY = gMY(e);

                checkMouseOver(mouseX, mouseY);
            }

            function over(id)
            {
                // Switch off the current menu, if any
                out();

                activeTD = gE(id);
                activeMenu = gE("menu_" + id);

                sB(activeTD, "#EEEEEE");
                sE(activeMenu);

                menuShowing = true;
            }

            function out()
            {
                if (activeMenu) hE(activeMenu);
                if (activeTD) sB(activeTD, "#FFFFFF");

                activeTD = null;
                activeMenu = null;
            }

            function overBlock(id)
            {
                sB(gE("menuBlock_" + id), "#87CDCB");
                sF(gE("menuBlock_" + id), "#FFFFFF");
            }

            function outBlock(id)
            {
                sB(gE("menuBlock_" + id), "#CFEDED");
                sF(gE("menuBlock_" + id), "#04417A");
            }

            function refreshSize()
            {
                if (!gE("topTable")) return;
                xPos = gW(gE("topTable"));



                for (i=arrIDs.length - 1; i>= 0; i--)
                {
                    topDiv = gE(arrIDs[i]);
                    dropdownDiv = gE("menu_" + arrIDs[i])

                    sX(topDiv, xPos - gW(topDiv));
                    sY(topDiv, 0);

                    sX(dropdownDiv, xPos - gW(dropdownDiv));
                    sY(dropdownDiv, gH(topDiv));

                    hE(dropdownDiv);
                    sE(topDiv);

                    xPos = xPos - gW(topDiv);
                }
            }


            function updateFrames(one, two)
            {
               parent.menu.location.href=one;
               parent.content.location.href=two;
            }
