// Variables
IsStartMenuOn = false;

// Special function for Start mouseout to prevent it from going to normal during showmenu.
function mouseoutStart()
{
    if (IsStartMenuOn == true)
        return;
    changePicture("Start", "images/toolbarstart.gif");
}

// Special function for Start mouseover to prevent it from going to normal during showmenu.
function mouseoverStart()
{
    if (IsStartMenuOn == true)
        return;

    changePicture("Start", "images/toolbarstart_over.gif");
}

// Special function for Start mousedown to prevent it from going to normal during showmenu.
function mousedownStart(Display)
{
    if (IsExMenuOn)
        ExMenuHide();
    
    if (IsStartMenuOn != true)
    {
        changePicture('Start','images/toolbarstart_clicked.gif');
        StartMenuShow(Display);   
    }
    else
    {
        StartMenuHide();
        changePicture("Start", "images/toolbarstart_over.gif");
    }
}

// Show the start menu.
//
function StartMenuShow(Display)
{
    LinkClick(1);
    var e = document.getElementById('Start');
    var m = document.getElementById('StartMenu');
    m.style.left = 0;
    if (Display == "inline")
    {
        m.style.top = getPageOffsetTop(e) - 256;
        document.getElementById('StartMenu_LoggedIn').style.display = "";
    }
    else
    {
        m.style.top = getPageOffsetTop(e) - 172;
        document.getElementById('StartMenu_LoggedIn').style.display = "none";
    }
    m.style.display = "";
    IsStartMenuOn = true;
}

// Hide the start menu.
function StartMenuHide()
{
    var m = document.getElementById('StartMenu');
    m.style.display = "none";
    document.getElementById('StartMenu_LoggedIn').style.display = "none";

    IsStartMenuOn = false;
    changePicture("Start", "images/toolbarstart.gif");
}