﻿var imMenuID = -1;

function ribbonChange(iMenuID, iPageID, oAnchor, bClick)
{
    if (iPageID == -1)
    {
        if (imMenuID == -1) {
            var oMenu = document.getElementById("hidMenuID");
            if (!oMenu) 
                return;

            imMenuID = parseInt(oMenu.value);
        }
        
        if (iMenuID != imMenuID)
        {
            document.getElementById("liRibbon_" + imMenuID).className = "";
            document.getElementById("liRibbon_" + iMenuID).className = "selected";

            document.getElementById("divMenu_" + imMenuID).style.display = "none";
            document.getElementById("divMenu_" + iMenuID).style.display = "block";
        }

        if (bClick)
            document.getElementById("aMenu_" + iMenuID).focus();
        else
            oAnchor.style.textDecoration = "underline";

        imMenuID = iMenuID;
    }
    else
        document.location = "default.asp?BasePageID=" + iPageID;	
}

function linkFocus(oAnchor)
{
	oAnchor.style.textDecoration = "underline";
}

function linkBlur(oAnchor)
{
	oAnchor.style.textDecoration = "";
}	

function switchText(sSwitch)
{
    var sLocation = document.location.href;
    var sParameter = "SwitchText=" + sSwitch;
    var iIndex = sLocation.indexOf("?SwitchText=");

    if (iIndex == -1)
        iIndex = sLocation.indexOf("&SwitchText=");

    if (iIndex > -1)
        sLocation = sLocation.slice(0, iIndex);

    var sJoin = "?";

    if (sLocation.indexOf("?") > -1)
        sJoin = "&";

    createCookie("LivingTextSize", sSwitch, 28);

    document.location = sLocation + sJoin + sParameter;
}

function pageLoad()
{
    defaultPageLoad();
    
}


