// ========== SECURITY ADMINISTRATION AND WORKFLOW
// This code creates a Logout button for Security Admin and Workflow, removes the 
// topic toc and collapses all sections by default.

$(document).ready(function() {
    if (Variables.IsSecAdmin || Variables.IsADA || Variables.IsDGS || Variables.IsDocViewer || 
        Variables.IsAuthoring ||  Variables.IsExpDocPortal || Variables.IsExpEng || 
        Variables.IsEZConfig || Variables.IsOAuth || Variables.IsOPPSA || Variables.IsOnPrem || 
        Variables.IsWKHosted || Variables.IsWKIS || Variables.IsMortgage) {
        // $('.wh_search_textfield').parent().append('<a id="btnLogout" class="btn btn-primary" title="Logout" href="/Logout.ashx"><i class="fa fa-sign-out"></i> Logout</a>');
        // $('.wh_publication_title').css('margin-right', '130px');
        // Add class to show elements with !important
        $('#logoutSeparator').addClass('show-important');
        $('#logoutButton').addClass('show-important');
    }
    // Remove the topic TOC
    // const RemoveTocSA     = window.location.href.indexOf("SecurityAdministration") != -1;
    // const RemoveTocMort	= window.location.href.indexOf("Mortgage") != -1;
    // const RemoveTocC1	    = window.location.href.indexOf("C1Administration") != -1;
    // const RemoveTocAss	= window.location.href.indexOf("Assumptions") != -1;

    if(Variables.RemoveTocSA || Variables.RemoveTocMort || Variables.RemoveTocC1 || Variables.RemoveTocAss) {
        $('#wh_topic_toc').remove();
    }

    // Collapse the sections by default
    // Comment the following line of code to have sections expanded by default
    if(window.location.href.indexOf("SecurityAdministration" || "Workflow") > -1) {
        CollapseSections();
        $( "section:gt( 0 )" ).CollapseSections();
    }
});

