function spnSignout_onclick() 
{
    top.document.location.replace("../Default.aspx?Logout=true");
}

function setLanguage(strLanguage) 
{
    top.location.replace("../Default.aspx?Language=" + strLanguage);
}

function replaceStripeMain(strLocation,objHighlightCell,strHighlightCellId)
{
    selectTopMenu(objHighlightCell,strHighlightCellId);

    var stripeMain = top.document.getElementById("studyB4Master_stripeMain");
    
    if (stripeMain && stripeMain.contentWindow)
    {
        var stripeMainContentWindow = stripeMain.contentWindow;

        if (stripeMainContentWindow.studyB4_SetBackgroundFilter)
            try
            {
                //main stripe main not be fully loaded - all we miss is the spinning icon
                stripeMainContentWindow.studyB4_SetBackgroundFilter(true);
            }
            catch(e)
            {
            }
        stripeMainContentWindow.location.replace(strLocation);
    }
}

function selectTopMenu(objHighlightCell,strHighlightCellId)
{
    //"Unclick" the selected menu
    var trMenu                  = document.getElementById("trMenu");

    for(var i=0; i<trMenu.childNodes.length; i++)
    {
        if (trMenu.childNodes[i].tagName && trMenu.childNodes[i].tagName.toUpperCase() == "TD")
            trMenu.childNodes[i].className = "cssMenu";
    }

    //Highlight the menu cell at the top
    if (objHighlightCell)
        objHighlightCell.className = "cssMenuSelected";
    else if (strHighlightCellId)
    {
        var objCell = document.getElementById("studyB4Master_bodyContent_" + strHighlightCellId);
        if (objCell)
            objCell.className = "cssMenuSelected";
    }

}

function setMenu(objMenu,strAction)
{
    switch (strAction)
    {
        case "out":
        {
            if (objMenu.className != "cssMenuSelected")
                objMenu.className = "cssMenu";
            break;
        }
        case "hover":
        {
            if (objMenu.className != "cssMenuSelected")
                objMenu.className = "cssMenuHover";
            break;
        }
    }
}
