// ========== 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.

var IsSecurityAdmin = window.location.href.indexOf("SecurityAdministration") > -1;
var IsADA           = window.location.href.indexOf("/ADA/") > -1;
var IsDGS           = window.location.href.indexOf("/DGS/") > -1;
var IsDocViewer     = window.location.href.indexOf("/DocViewer/") > -1;
var IsExpAuth       = window.location.href.indexOf("/Expere/Authoring/") > -1;
var IsExpDocPortal  = window.location.href.indexOf("/Expere/DocumentPortal/") > -1;
var IsExpEng        = window.location.href.indexOf("/Expere/Engine/") > -1;
var IsEZConfig      = window.location.href.indexOf("/ExpereEZConfig/") > -1;
var IsOAuth         = window.location.href.indexOf("/OAuth/") > -1;
var IsOPPSA         = window.location.href.indexOf("/OPPSA/") > -1;
var IsOnPrem        = window.location.href.indexOf("/OPPSA-OnPrem/") > -1;
var IsWKHosted      = window.location.href.indexOf("/WK-Hosted-Expere/") > -1;
var IsWKIS          = window.location.href.indexOf("/WK-IntegratedSolutions/") > -1;

if(IsSecurityAdmin || IsADA || IsDGS || IsDocViewer || IsExpAuth || 
    IsExpDocPortal || IsExpEng || IsEZConfig || IsOAuth || IsOPPSA ||
    IsOnPrem || IsWKHosted || IsWKIS) {
    $('.wh_header').prepend('<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');
    
    // $('#wh_topic_body').css('width', '95%');
    // $('#collapse').show();
}
// Remove the topic TOC
var RemoveTocSA     = window.location.href.indexOf("SecurityAdministration") != -1;
var RemoveTocMort	= window.location.href.indexOf("Mortgage") != -1;
var RemoveTocC1	    = window.location.href.indexOf("C1Administration") != -1;
var RemoveTocAss	= window.location.href.indexOf("Assumptions") != -1;

if(RemoveTocSA || RemoveTocMort || RemoveTocC1 || 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();
}
