﻿function OnHighlightLeftMenu(state, item)
{
    try
    {
        if(item != null)
        {
            switch(state)
            {
                case 0:
                    item.style.backgroundImage="url(Images/LeftMenuBackground_hl.gif)";
                break;
                
                case 1:
                    item.style.backgroundImage="url(Images/LeftMenuBackground.gif)";
                break;
            }
        }
    }
    catch(err)
    {
    }
}

function OnSelectLeftMenu(url)
{
    try
    {
        window.location.href = url;
    }
    catch(err)
    {
    }
}

function OnToggleLeftMenuVisibility(displayNav)
{
    try
    {
        var newUrl = window.location.href;
        if (window.location.href.match(/DISPLAY_NAVIGATION\=./i) == null)
        {
            if(window.location.href.search(/\?/) > 0)
                newUrl = window.location.href + "&DISPLAY_NAVIGATION=" + displayNav;
            else newUrl = window.location.href + "?DISPLAY_NAVIGATION=" + displayNav;
        }
        else 
        {
            newUrl = window.location.href.replace(/DISPLAY_NAVIGATION\=./i, 'DISPLAY_NAVIGATION=' + displayNav);
        }
        window.location.href = newUrl;
    }
    catch(err)
    {
    }
}
