$(document).ready(function()
{
    if(v.moduleID) $('#treebox a[href*=' + v.moduleID + ']').click().parent().addClass('active');

    $(document).on('click', '.fix-menu', function()
    {   
        $.getJSON($(this).attr('href'), function(data) 
        {   
            if(data.result == 'success')
            {   
                return location.reload();
            }   
            else
            {   
                alert(data.message);
                return location.reload();
            }   
        }); 
        return false;
    });

    /* expand active tree. */
    if(v.mode == 'bytree') $('.tree').tree('expandSelect', '.active');
});

function setBrowseType(type)
{
    $.cookie('browseType', type, {expires:config.cookieLife, path:config.webRoot});
    location.href = location.href;
}
