<%@page import="org.apache.commons.lang.math.NumberUtils"%>
<%@taglib prefix="security" uri="http://www.springframework.org/security/tags"%>
<%@ page import="java.sql.*,java.util.Vector,IMSPackage.UserMgmtCheck,sapphire.reports.*,IMSPackage.*,java.text.DecimalFormat" %>
<%@page import="org.apache.commons.logging.Log,org.apache.commons.logging.LogFactory"%>
<%@page import="java.util.Date,java.util.Calendar,java.util.*,java.text.DateFormat,java.text.SimpleDateFormat"%>
<%@page import="java.io.Serializable,sapphire.ui.SapphireConfigsettings"%>
<%@page import="com.sapphire.bsm.common.GetBsmUserRoles,sapphire.servicedesk.utils.GetUserData"%>
<%@page import="org.xnap.commons.i18n.I18n"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="com.sapphire.base64util.Base64"%>  
<%@page import="com.sapphireims.web.filter.SapphireFilterUtil"%>
<%@ page import="com.sapphireims.service.IConfigSettingService" %>
<%@ page import="com.sapphireims.service.impl.SpringContextUtil" %>


<style type="text/css">
    /* this css code snippet is added to auto resize column header */  
    .x-column-header-inner .x-column-header-text {
        white-space: normal;
    }
    .x-column-header-inner {
        line-height: normal;
        padding-top: 3px !important;
        padding-bottom: 3px !important;
        top: 20%;
    }
    <%
        if (session.getAttribute("I18N_LANGUAGE_ID") != null && !(((String) session.getAttribute("I18N_LANGUAGE_ID")).equals("1"))) {
    %> 
    .addbuttons {
        white-space: normal;
        height: auto !important;
        width: auto !important;
    }
    <% }%>
</style>
<script type="text/javascript" src="assets/js/jquery.min.js"></script>
<script type="text/javascript" src="js/interaction.js"></script>
<script type="text/javascript">
    jQuery(function(){if(jQuery("#inventorySM").find("li").length>13){jQuery("#inventorySM").parents("#subNavigation").css("width","90%")}});
</script>
<%
    String telantName1 = (String) session.getAttribute("TELANTNAME");
    Sapphire1 topTable_sapp1_obj = new Sapphire1();
    IConfigSettingService configSettingServiceTopTable = (IConfigSettingService) SpringContextUtil.getBeanByName("configSettingService");
    SapphireConfigsettings sapphireConfigsettings=new SapphireConfigsettings();
   int policyAnalyzer =NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("SHOW_POLICYANALYZER_FEATURE_UI"));
   int osDeployement = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("SHOW_OSD_FEATURE_UI"));
   int folderBackUp = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("SHOW_FOLDERBACKUP_FEATURE_UI"));
   int processFlow = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("SHOW_PROCESSFLOW_FEATURE_UI"));
   int applicationdiscover = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("SHOW_ADDM_FEATURE_UI"));
   int businessService =NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("SHOW_BUSINESSSERVICE_FEATURE_UI"));
   int businessSLA = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("SHOW_BUSINESSSLA_FEATURE_UI"));
   int businessMap = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("SHOW_BUSINESSMAPS_FEATURE_UI"));
   int sanFeature = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("SHOW_SAN_FEATURE_UI"));
   int dynamicThreshold = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("SHOW_DYNAMICTHRESHOLDS_FEATURE_UI"));
   int alarmCorrelation = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("SHOW_ALARMCORRELATION_FEATURE_UI"));
   int ipmi = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("SHOW_IPMI_FEATURE_UI"));
    int securityQuestionEnabledT = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("ENABLE_SECURITY_QUESTION"), 0);
    request.setAttribute("ENABLE_SECURITY_QUESTION", securityQuestionEnabledT);
   int secretPinEnabledT = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("ENABLE_SECURITYPIN"), 0);
    request.setAttribute("ENABLE_SECURITYPIN", secretPinEnabledT);
   int passwordResetEnabledT = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("PASSWORD_RESET_ENABLE"), 0);
    request.setAttribute("PASSWORD_RESET_ENABLE", passwordResetEnabledT);
    int unlockAdAccountT = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("UNLOCK_AD_ACCOUNT"), 0);
    request.setAttribute("UNLOCK_AD_ACCOUNT", unlockAdAccountT);
%>
<c:set var="businessMap" value="<%=businessMap%>"/>
<c:set var="businessService" value="<%=businessService%>"/>
<c:set var="businessSLA" value="<%=businessSLA%>"/>
<c:set var="sanFeature" value="<%=sanFeature%>"/>
<c:set var="I18N_OBJECT" value="${applicationScope.LANGUAGE_MAP[LANGUAGE_UNICODE]}" />
<script type="text/javascript">
    jQuery(function () {
        jQuery(document).ajaxSend(function (e, xhr, options) {
            xhr.setRequestHeader("${_csrf.headerName}", "${_csrf.token}");
        });
    });
    <%
        SimpleDateFormat serverTimeformat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
        serverTimeformat.setTimeZone(TimeZone.getTimeZone((String) session.getAttribute("USER_TIMEZONE")));
    %>
    var currenttime = '<%=serverTimeformat.format(new Date())%>';
    var montharray = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
    var serverdate = new Date(currenttime);

    function applicationLogout(type) {
        var globalLogout = '<input type ="hidden" name ="local" id ="local" value="true"/>';
        jQuery('<form action="<c:out value="<%=SapphireFilterUtil.sapphireContextPath%>"/>/applicationLogout.do" method="post"><input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>\n\
    ' + globalLogout + '</form>').appendTo('body').submit();
    }
    <%
        serverTimeformat = new SimpleDateFormat("z");
        serverTimeformat.setTimeZone(TimeZone.getTimeZone((String) session.getAttribute("USER_TIMEZONE")));
    %>
</script>
<script type="text/javascript" src="js/toptable.js"></script>
<%
    try {

        int sapphireInstallType_toptable = Integer.parseInt((String) session.getAttribute("SIMS_INSTALL_TYPE"));
        String showSymbol = "|";
        boolean isMyAssetIsInMenu = false;
        //   Date scheduledTime_toptable = null;
        // Date now_toptable = null;
        String moduleType = "main_menu_home";
        String subModuleType = "";
        String separator = "";
        UserMgmtCheck objec = new UserMgmtCheck();
        Sapphire sappObj_toptable = new Sapphire();
        String defaultSiteID = "1";
        if (session.getAttribute("BSMACCESSCHECK") == null || session.getAttribute("TOPTABLE_MASTER_ADMIN") == null) {
            objec.setUserModuleData(session);
        }
        if (sapphireInstallType_toptable != 1) {
            defaultSiteID = sappObj_toptable.getDefaultSelectedSiteFromSession((String) session.getAttribute("LOGGEDUSERID"), session, false);
        }
        boolean isPluginInstalled = Sapphire.isPluginInstalled; //Is Loganalyzer plugin installed or not.
        String profilePicture = "<img id=\"newUIprofilePictureLnk\" src=\"assets/images/icon/human.png\" class=\"ico-profile\" alt=\"\" data-from=\"1\">";
        if(session.getAttribute("UserImageName") != null){
            profilePicture = "<img id=\"newUIprofilePictureLnk\" src=\"Download?fileName="+session.getAttribute("UserImageName")+"&fileNameOriginal="+session.getAttribute("UserImageName")+"\" class=\"ico-profile\" alt=\"\" data-from=\"1\">";
        } else if(session.getAttribute("USERINITIALS") != null){
           profilePicture = "<span id=\"newUIprofilePictureLnk\" class=\"profileInital\" data-from=\"1\" data-initials=\""+session.getAttribute("USERINITIALS")+"\">"+session.getAttribute("USERINITIALS")+"</span>" ;
        }
        String profilePicture1 = "<img  src=\"assets/images/default-profile-temp.png\"  alt=\"\" >";
        if(session.getAttribute("UserImageName") != null){
            profilePicture1 = "<img  src=\"Download?fileName="+session.getAttribute("UserImageName")+"&fileNameOriginal="+session.getAttribute("UserImageName")+"\"  alt=\"\">";
        } else if(session.getAttribute("USERINITIALS") != null){
            profilePicture1 = "<span  class=\"profileInital\" data-from=\"1\" data-initials=\""+session.getAttribute("USERINITIALS")+"\">"+session.getAttribute("USERINITIALS")+"</span>" ;
        }
        /*
    *   0-Home
    *   1-Fault
    *   2-Performance
    *   3-Security
    *   4-Invenrtory    
         */
        if (request.getParameter("module") != null) {
            if (request.getParameter("module").equalsIgnoreCase("1")) {
                moduleType = "1";
            } else if (request.getParameter("module").equalsIgnoreCase("2")) {
                moduleType = "2";
            } else if (request.getParameter("module").equalsIgnoreCase("3")) {
                moduleType = "3";
            } else if (request.getParameter("module").equalsIgnoreCase("4")) {
                moduleType = "4";
            }
        }

        String lastLoginTime = "";
        String userTimeZone_Header = (String) session.getAttribute("USER_TIMEZONE");
        SimpleDateFormat displayLastLoginTimeFormat = new SimpleDateFormat("MMMM dd, yyyy HH:mm:ss z");
        displayLastLoginTimeFormat.setTimeZone(TimeZone.getTimeZone(userTimeZone_Header));
        if (session.getAttribute("LAST_LOGIN_TIME") == null || session.getAttribute("LAST_LOGIN_TIME").equals("null") || session.getAttribute("LAST_LOGIN_TIME").equals("0000-00-00 00:00:00")) {
            lastLoginTime = displayLastLoginTimeFormat.format((Date) new Date());
        } else {
            lastLoginTime = displayLastLoginTimeFormat.format((Date) session.getAttribute("LAST_LOGIN_TIME"));
        }
        String AssetModule_ID = "1";
        I18n toptable_i18n = Sapphire.LANGUAGE_MAP.get((String) session.getAttribute("LANGUAGE_UNICODE"));
        String messageText = toptable_i18n.tr("Evaluation period expires on");
        //String language_unicode = (String) session.getAttribute("LANGUAGE_UNICODE");
        if (session.getAttribute("MAINMENU_ID") != null) {
            moduleType = (String) session.getAttribute("MAINMENU_ID");
            //session.removeAttribute("MAINMENU_ID");
        } else {
            session.setAttribute("MAINMENU_ID", moduleType);
        }

        if (session.getAttribute("MAINMENU_SUB_ID") != null) {
            subModuleType = (String) session.getAttribute("MAINMENU_SUB_ID");
        } else {
            session.setAttribute("MAINMENU_SUB_ID", subModuleType);
        }
        if (session.getAttribute("AssetModule_ID") != null) {
            AssetModule_ID = (String) session.getAttribute("AssetModule_ID");
        }
        //Collect the login name from user.

        String username = (String) session.getAttribute("login");
        if (username == null) {
            username = "admin";
        }
        //  String tempRoles = (String) session.getAttribute("BSMMAPPEDROLES");
        int allowBsm = Integer.parseInt((String) session.getAttribute("BSMACCESSCHECK"));

        int faultAccess = 0;
        /* AR code start */
        //Commented, may required this code when we support AR for PLATFORM
        //check global access for Advanced Reports
        /*int advacncedReportEnabled = 0;
            if( application.getAttribute("ENABLE_ADVANCED_REPORT") != null && !application.getAttribute("ENABLE_ADVANCED_REPORT").toString().isEmpty() ){
            advacncedReportEnabled = Integer.valueOf(application.getAttribute("ENABLE_ADVANCED_REPORT").toString());
            }
         */
 /* AR code end */
        String topTable_userID = (String) session.getAttribute("LOGGEDUSERID");
        boolean showProductHealth = true;
        int top_tablesitesCount = 0;
        if (sapphireInstallType_toptable == 3 || sapphireInstallType_toptable == 4 || sapphireInstallType_toptable == 5) {
            top_tablesitesCount = sappObj_toptable.getAllSitesList(topTable_userID, false, telantName1).split(",").length;

            try (Connection topTable_conn = new connection().getConnection(telantName1);) {
                if ((sapphireInstallType_toptable == 3 || sapphireInstallType_toptable == 4 || sapphireInstallType_toptable == 5) && top_tablesitesCount == 1 && topTable_sapp1_obj.isVirtualProbe(topTable_conn, defaultSiteID)) {
                    showProductHealth = false;
                }
            }
        }
        String fullName=(String)session.getAttribute("USER_IDENTITY");
        if (fullName.length() > 40){
            fullName =fullName.substring(0,40).concat("...");
        }

%>

<c:set var="ContextPath" value="<%=SapphireFilterUtil.sapphireContextPath%>"/>
<div id="outerWrapper">
    <div id="innerWrapper">
        <div id="header_new">
            <%if(session.getAttribute("SERVICEDESK_NEWUI_PAGE")!= null){%>
            <c:if test="${not empty sessionScope.PASSWORDEXPDATE}">
                <marquee style="font-size: inherit;color:#FFCA28;font-weight:600;width:auto;margin-top:20px;">
                        ${sessionScope.PASSWORDEXPDATE} <a href="..${ContextPath}/preferenceConfiguration.do?reqID=2&serviceDesk=no&isNewUIAvailable=yes" style="font-size: small;color: blue;"><%=toptable_i18n.tr("click here to reset")%></a>
                </marquee>
            </c:if>
            <% } %>
            <c:choose>
                <c:when test="${not empty sessionScope.MSPSERVERURL}">
                    <a href="<%=session.getAttribute("MSPSERVERURL")%>/MSPHomePage.jsp"><img src="${sessionScope.headerLogoPath}" height="55" border="0" id="sapphireIMS_logo"/></a>
                    </c:when>
                    <c:when test="${sessionScope.ONLY_INVENTRY_USER}">
                    <a href='reDirectionPage.do?subModule=sub_menu_inve' title="Home"><img src="${sessionScope.headerLogoPath}" height="55" alt="SapphireIMS Logo" id="sapphireIMS_logo"/></a>
                    </c:when>
                    <c:otherwise>
                    <a href='reDirectionPage.do?module=main_menu_home' title="Home"><img src="${sessionScope.headerLogoPath}" height="55" alt="SapphireIMS Logo" id="sapphireIMS_logo"/></a>
                    </c:otherwise>
                </c:choose>
 
            <div id="mainactions" class="oldUiHeadSections">
                <c:if test="${not empty sessionScope.MSPSERVERURL}">
                    <span class="msg">[<%=((String) Sapphire.applicationScope.getAttribute(telantName1 + "_CUSTOMER_NAME")).trim()%>] </span>
                </c:if>
            <c:if test="${sessionScope.SIMS_INSTALL_TYPE ne '3'}" >
                <span class="msg1"><%=((String) session.getAttribute("LICENSEEXPDATE")).replace("Evaluation period expires on", messageText)%></span>&nbsp;&nbsp;
            </c:if>
                <span class="msg" style="cursor:pointer" title="${sessionScope.USER_IDENTITY}">[<%= toptable_i18n.tr("Last Login")%>: <%=lastLoginTime%>]&nbsp; [<%=fullName%>]</span>&nbsp;
                <%if (((int) session.getAttribute("TOPTABLE_MASTER_ADMIN")) == 1 && showProductHealth) {%><span class="reminders"><a href="..${ContextPath}/selfHealth.do?PerformanceViewID=361"><%=toptable_i18n.tr("Product Health")%></a></span>&nbsp;|&nbsp;<%}%>
                <span class="reminders">
                    <a href="..${ContextPath}/ChangePassword.do?serviceDesk=no&isNewUIAvailable=yes"><%=toptable_i18n.tr("Preferences")%></a></span>&nbsp;|&nbsp;
                    <c:choose>
                        <c:when test="${not empty sessionScope.SAMLGLOBALLOGOUT}">
                        <span class=""><a href="javascript:applicationLogout(1)"><%=toptable_i18n.tr("Logout")%></a></span>
                        <input type ="hidden" name ="applicationLogoutTypeOldUI" id ="applicationLogoutTypeOldUI" value="1" />
                        </c:when>
                        <c:otherwise>
                        <span class=""><a href="javascript:applicationLogout(0)"><%=toptable_i18n.tr("Logout")%></a></span>
                        <input type ="hidden" name ="applicationLogoutTypeOldUI" id ="applicationLogoutTypeOldUI" value="0" />
                        </c:otherwise>
                    </c:choose>
            </div>
            <div id="mainactions" class="newUiHeadSections" style="display:none">
                <c:if test="${not empty sessionScope.MSPSERVERURL}">
                    <span class="msg">[<%=((String) Sapphire.applicationScope.getAttribute(telantName1 + "_CUSTOMER_NAME")).trim()%>] </span>
                </c:if>
                <span class="timeStamp"><span id="servertime"></span>&nbsp;<%=serverTimeformat.format(new Date())%></span>
                <c:if test="${sessionScope.SIMS_INSTALL_TYPE ne '3'}" ><span class="msg1"><span><%=((String) session.getAttribute("LICENSEEXPDATE")).replace("Evaluation period expires on", messageText)%></span></span>&nbsp;&nbsp;</c:if>
                <%if (((int) session.getAttribute("TOPTABLE_MASTER_ADMIN")) == 1 && showProductHealth) {%><span class="reminders"><a href="..${ContextPath}/selfHealth.do?PerformanceViewID=361&isNewUIAvailable=yes" class="proHealth" title="<%=toptable_i18n.tr("Product Health")%>"></a></span><%}%>
                <a href="javascript:void(0)"><%=profilePicture%></a>
                <div class="userNav EnabledChangePasswordBlk" id="userNav">
                    <span class="topArrow"></span>
                    <div class="menuAll menuExtd" style="height: 213px;">
                        <div class="userMenu move"><input type="hidden" id="isAssetProfile" value="no">
                            <div class="profView">
                                <div id="prof" class="profInner">
                                    <p> ${sessionScope.USER_IDENTITY}</p>
                                    <a href="javascript:void(0)" class="uploadProfile">
                                        <%=profilePicture1%>
                                    </a>
                                </div>
                                <ul id="profNav" class="profNav">
                                    <li>
                                        <a href="..${ContextPath}/ChangePassword.do?serviceDesk=no&isNewUIAvailable=yes">
                                        <i class="comSprite profIco"></i>
                                        <strong><%=toptable_i18n.tr("Profile Change")%></strong>
                                        </a>
                                    </li>
                                    <c:if test="${PASSWORD_ALLOWED eq 0 && HIDE_CURRENT_PASS_PREFERRED_CONTACT eq 0}">
                                        <li>
                                            <a href="..${ContextPath}/preferenceConfiguration.do?reqID=2&isNewUIAvailable=yes&serviceDesk=no">
                                                <i class="comSprite privIco"></i>
                                                <strong><%=toptable_i18n.tr("Change Password")%></strong>
                                            </a>
                                        </li>
                                    </c:if>
                                    <c:if test="${(PASSWORD_RESET_ENABLE eq 1 || UNLOCK_AD_ACCOUNT eq 1 ) && (ENABLE_SECURITYPIN eq 1 || ENABLE_SECURITY_QUESTION eq 1) }">
                                        <li>
                                            <a href="..${ContextPath}/preferenceConfiguration.do?reqID=3&isNewUIAvailable=yes&serviceDesk=no">
                                                <i class="comSprite secureIco"></i>
                                                <strong><%=toptable_i18n.tr("Security Details")%></strong>
                                            </a>
                                        </li>
                                    </c:if>
                                </ul>
                            </div>
                            <a href="javascript:void(0)" class="backBtn"></a>
                        </div>
                    </div>
                    <div class="logOutBlk">
                        <c:choose>
                            <c:when test="${not empty sessionScope.SAMLGLOBALLOGOUT}">
                                <a href="javascript:applicationLogout(1)">
                                    <i class="logIco comSprite"></i><%=toptable_i18n.tr("Logout")%>
                                </a>
                                <input type ="hidden" name ="applicationLogoutTypeOldUI" id ="applicationLogoutTypeOldUI" value="1" />
                            </c:when>
                            <c:otherwise>
                                <a href="javascript:applicationLogout(0)">
                                    <i class="logIco comSprite"></i><%=toptable_i18n.tr("Logout")%>
                                </a>
                                <input type ="hidden" name ="applicationLogoutTypeOldUI" id ="applicationLogoutTypeOldUI" value="0" />
                            </c:otherwise>
                        </c:choose>
                        <p class="lastLogin">Last Login: : <%=lastLoginTime%></p>
                    </div>
                </div>
			

            </div>
            <%
                String CMDB_Home = "";
                String cmdbStyle = "navigation";
                if (session.getAttribute("CMDB_HOME") != null) {
                    CMDB_Home = (String) session.getAttribute("CMDB_HOME");
                    cmdbStyle = "cmdbnavigation";
                }
                Integer enabledModule = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("MODULES_Enabled"));
                boolean itsmEnabled = (enabledModule == 1 || enabledModule == 3);
            %>
            <div id="<%=cmdbStyle%>" >
                  <% if ((String) session.getAttribute("SERVICEDESK_NEWUI_PAGE") != null && ((String) session.getAttribute("SERVICEDESK_NEWUI_PAGE")).equals("1")) {%>
					<div>
					<%}%>
                <span class="timeStamp"><span id="servertime"></span>&nbsp;<%=serverTimeformat.format(new Date())%></span>
                <ul>
            <c:if test="${ sessionScope.isReportingServer != 1}">
                    <c:choose>
                        <c:when test="${sessionScope.MAINMENU_ID eq 'main_menu_home'}">
                            <li id="home" class="default"><a href="reDirectionPage.do?module=main_menu_home" title=""><%=toptable_i18n.tr("Home")%></a></li>
                            </c:when>
                            <c:when test="${empty sessionScope.CMDB_HOME}">
                            <li id="home"><a href="reDirectionPage.do?module=main_menu_home" title=""><%=toptable_i18n.tr("Home")%></a></li>
                            </c:when>
                        </c:choose>
                        <c:if test="${sessionScope.ALLOW_FAULT_TAB eq 1}">
                        <li id="fault"  ${sessionScope.MAINMENU_ID eq 'main_menu_fault' ? 'class="default"' : ''} ><a href="reDirectionPage.do?module=main_menu_fault" title=""><%=toptable_i18n.tr("Fault")%></a></li>
                        </c:if>
                        <%
                            int allow_main_system_toptable = (int) session.getAttribute("ALLOW_FAULT_TAB");
                            faultAccess = allow_main_system_toptable;
                            int access1 = (int) session.getAttribute("ALLOW_SHARE_BSM_TAB");
                        %>
                        <c:if test="${(sessionScope.ALLOW_PERFORMANCE_TAB eq 1 && sessionScope.BSMACCESSCHECK eq 1) || sessionScope.ALLOW_SHARE_BSM_TAB eq 1}">
                        <li id="performance" ${sessionScope.MAINMENU_ID eq 'main_menu_perf' ? 'class="default"' : ''}><a href="reDirectionPage.do?module=main_menu_perf" title=""><%=toptable_i18n.tr("Performance")%></a></li>
                        </c:if>
                        <c:if test="${sessionScope.ALLOW_SECURITY_TAB eq 1}">
                        <li id="security" ${sessionScope.MAINMENU_ID eq 'main_menu_secu' ? 'class="default"' : ''}><a href="reDirectionPage.do?module=main_menu_secu" title=""><%=toptable_i18n.tr("IT Automation")%></a></li>
                        </c:if>
                        <c:choose>
                            <c:when test="${sessionScope.ALLOW_Inventory_TAB eq 1}">
                            <li id="inventory" ${sessionScope.MAINMENU_ID eq 'main_menu_inv' ? 'class="default"' : ''}><a href="reDirectionPage.do?module=main_menu_inv" title="" ><%=toptable_i18n.tr("Inventory")%></a></li>
                            </c:when>
                            <c:when test="${sessionScope.ALLOW_Compliance_View_TAB eq 1}">
                            <li id="inventory" ${sessionScope.MAINMENU_ID eq 'main_menu_inv' ? 'class="default"' : ''}><a href="#" title="" ><%=toptable_i18n.tr("Inventory")%></a></li>
                            </c:when>
                        </c:choose>
                        <%

                        if(itsmEnabled){
							String itsmContextPath= "../" + configSettingServiceTopTable.findBySettingKey("ITSM_CONTEXTPATH") + "/";
                            if (moduleType.equalsIgnoreCase("main_menu_cmdb")) {
                                String cmdbLabel = (String) application.getAttribute(telantName1 + "_CMDB_LABEL");
                                int allowAsset = (int) session.getAttribute("PRIVILEGE_Asset_Management_TAB");
                                if (allowAsset == 1) {
                                    isMyAssetIsInMenu = true;
                                    if ((String) session.getAttribute("LOGGEDUSERMODULEVIEW") != null && ("," + (String) session.getAttribute("LOGGEDUSERMODULEVIEW") + ",").contains(",0,")) {%> 
                    <li id="cmdb" ><a href="#" title="" target="_blank"><%=toptable_i18n.tr(cmdbLabel)%> </a></li>
                        <%} else {%>
                    <li id="cmdb" ><a href="<%=itsmContextPath%>CMDBRedirectionURL.do?isCMDBHomePage=yes"" title="" target="_blank"><%=toptable_i18n.tr(cmdbLabel)%> </a></li>
                        <%}
                            }

                            if (!isMyAssetIsInMenu) {
                                cmdbLabel = (String) application.getAttribute(telantName1 + "_MYASSET_LABEL");
                                allow_main_system_toptable = 0;
                                allow_main_system_toptable = (int) session.getAttribute("PRIVILEGE_My_Asset_TAB");
                                if (allow_main_system_toptable == 1) {
                                    if ((ArrayList) session.getAttribute("ASSETS_ALLOCATED_TO_USERS") != null) {
                                        ArrayList allocatedAssetsHostName = (ArrayList) session.getAttribute("ASSETS_ALLOCATED_TO_USERS");
                                        if (allocatedAssetsHostName.size() > 0) {
											String itsmContextPathForLP2= "../" + configSettingServiceTopTable.findBySettingKey("ITSM_CONTEXTPATH") + "/";
											String isConfigNewUI2="false";
											if(session.getAttribute("SERVICEDESK_NEWUI_PAGE")!= null && request.getParameter("isNewUIAvailable")!=null && request.getParameter("isNewUIAvailable").equals("yes")){
					                                isConfigNewUI2="true";
					                        }
                        %>
                    <li id="myAsset" class="default"><a <%if(isConfigNewUI2.equals("true")){%>href="<%=itsmContextPathForLP2%>viewTicketList.do?#myAssetsRedirect"<%}else{%>href="reDirectionPage.do?module=main_menu_cmdb&myasset=yes"<%}%> title=""><%=toptable_i18n.tr(cmdbLabel)%></a></li>
                        <%  }
                                    }
                                }
                            }
                        %>
                        <%} else {
                            int allowAsset = (int) session.getAttribute("PRIVILEGE_Asset_Management_TAB");
                            String cmdbLabel = (String) application.getAttribute(telantName1 + "_CMDB_LABEL");
                            if (allowAsset == 1) {
                                isMyAssetIsInMenu = true;
                                if (("," + (String) session.getAttribute("LOGGEDUSERMODULEVIEW") + ",").contains(",0,")) {%> 
                    <li id="cmdb" ><a href="#" title="" target="_blank"><%=toptable_i18n.tr(cmdbLabel)%> </a></li>
                        <%} else {%>                                                            
                    <li id="cmdb" ><a href="<%=itsmContextPath%>CMDBRedirectionURL.do?isCMDBHomePage=yes" title="" target="_blank"><%=toptable_i18n.tr(cmdbLabel)%> </a></li>
                        <%}
                            }
                            if (!isMyAssetIsInMenu) {
                                cmdbLabel = (String) application.getAttribute(telantName1 + "_MYASSET_LABEL");
                                allow_main_system_toptable = 0;
                                allow_main_system_toptable = (int) session.getAttribute("PRIVILEGE_My_Asset_TAB");
                                if (allow_main_system_toptable == 1) {
                                    if ((ArrayList) session.getAttribute("ASSETS_ALLOCATED_TO_USERS") != null) {
                                        ArrayList allocatedAssetsHostName = (ArrayList) session.getAttribute("ASSETS_ALLOCATED_TO_USERS");
                                        if (allocatedAssetsHostName.size() > 0) {
String itsmContextPathForLP3= "../" + configSettingServiceTopTable.findBySettingKey("ITSM_CONTEXTPATH") + "/";
							String isConfigNewUI3="false";
							if(session.getAttribute("SERVICEDESK_NEWUI_PAGE")!= null && request.getParameter("isNewUIAvailable")!=null && request.getParameter("isNewUIAvailable").equals("yes")){
	                                isConfigNewUI3="true";
	                        } 
                        %>
                    <li id="myAsset"><a <%if(isConfigNewUI3.equals("true")){%>href="<%=itsmContextPathForLP3%>viewTicketList.do?#myAssetsRedirect"<%}else{%>href="reDirectionPage.do?module=main_menu_cmdb&myasset=yes" <%}%>title=""><%=toptable_i18n.tr(cmdbLabel)%></a></li>
                        <%  }
                                        }
                                    }
                                }
                            }
                        }
                        %>
            </c:if>
                        <c:if test="${sessionScope.ALLOW_Reports_TAB eq 1}">
                        <li id="reports"  ${sessionScope.MAINMENU_ID eq 'main_menu_reports' ? 'class="default"' : ''}><a href="#" title=""><%=toptable_i18n.tr("Reports")%></a></li>
                        </c:if>
            <c:if test="${ sessionScope.isReportingServer != 1}">
                        <%
                        int serviceDeskUser = (int) session.getAttribute("ALLOW_Service_Desk_User_TAB");
                        int serviceDeskAdmin = (int) session.getAttribute("ALLOW_Service_Desk_Admin_TAB");
//                        Integer enabledModules = NumberUtils.toInt(application.getAttribute(telantName1 + "_MODULES_Enabled").toString(), 3);
//                        boolean itsmEnabled = (enabledModules == 1 || enabledModules == 3);
                        if (itsmEnabled && (serviceDeskUser == 1 || serviceDeskAdmin == 1)) {
                            if (moduleType.equalsIgnoreCase("main_menu_sd_home")) {
                                Map projectallow = new GetUserData().getAllowedProjects((String) session.getAttribute("LOGGEDUSERID"), telantName1);
                                if (projectallow.size() != 0) {
                                    if ((String) session.getAttribute("SERVICEDESK_NEWUI_PAGE") != null && ((String) session.getAttribute("SERVICEDESK_NEWUI_PAGE")).equals("1")) {
                    %>
                    <li id="sdHome" class="default"><a href="reDirectionPage.do?module=main_menu_newui&onClickParam=true" target="_blank" title=""><%=toptable_i18n.tr("Service Desk")%>&nbsp;<img src="newWindow.jpg" border="0" /></a></li>
                            <% } else {%>        
                    <li id="sdHome" class="default"><a href="reDirectionPage.do?<%=session.getAttribute("DEFAULT_SERVICEDESK_HOMEPAGE")%>&onClickParam=true" target="_blank" title=""><%=toptable_i18n.tr("Service Desk")%>&nbsp;<img src="newWindow.jpg" border="0" /></a></li>
                            <%                  }
                                }
                            } else {
                                Map projectallow = new GetUserData().getAllowedProjects((String) session.getAttribute("LOGGEDUSERID"), telantName1);
                                if (projectallow.size() != 0) {
                                    if ((String) session.getAttribute("SERVICEDESK_NEWUI_PAGE") != null && ((String) session.getAttribute("SERVICEDESK_NEWUI_PAGE")).equals("1")) {
                            %>  
                    <li id="sdHome"><a href="reDirectionPage.do?module=main_menu_newui&onClickParam=true" target="_blank" title=""><%=toptable_i18n.tr("Service Desk")%>&nbsp;<img src="newWindow.jpg" border="0" /> </a></li>
                            <% } else {%>
                    <li id="sdHome"><a href="reDirectionPage.do?<%=session.getAttribute("DEFAULT_SERVICEDESK_HOMEPAGE")%>&onClickParam=true" target="_blank" title=""><%=toptable_i18n.tr("Service Desk")%>&nbsp;<img src="newWindow.jpg" border="0" /> </a></li>
                            <%              }
                                        }
                                    }
                                }
                            %>
                            <c:if test="${sessionScope.SIMS_INSTALL_TYPE ne '2'}">
                                <c:if test="${ (sessionScope.ALLOW_Settings_TAB eq 1) || (sessionScope.ALLOW_SD_SETTING_PERMISSION eq 1) || (sessionScope.ALLOW_Compliance_Operations_TAB eq 1)}">
                            <li id="settingsSM" ${sessionScope.MAINMENU_ID eq 'main_menu_settings' ? 'class="default"' : ''}><a href="reDirectionPage.do?module=main_menu_settings" title="" class="last"><%=toptable_i18n.tr("Settings")%></a></li>
                            </c:if>
                        </c:if>
            </c:if>
                </ul>
                <a id="pinMenu" href="javascript:void(0)" title="Pin Panel" class="pinPanelIco">
                    <i class="ico pinIco"></i>
                </a>
            </div>
                <%if ((String) session.getAttribute("SERVICEDESK_NEWUI_PAGE") == null) {%>
                <c:if test="${not empty sessionScope.PASSWORDEXPDATE}">
                    <marquee style="font-size: inherit;color:#FFCA28;font-weight:600;width:auto;margin-top:33px;">
                            ${sessionScope.PASSWORDEXPDATE} <a
                            href="..${ContextPath}/preferenceConfiguration.do?reqID=2&serviceDesk=no&isNewUIAvailable=yes"
                            style="font-size: small;color: blue;"><%=toptable_i18n.tr("click here to reset")%>
                    </a>
                    </marquee>
                </c:if>
                <% } %>
</div>
            <div id="subNavigationAlertBackground">
                <div id="subNavigation" style="width:90%">
                  
                <c:if test="${ sessionScope.isReportingServer !=1}">
                    <ul id="homeSM" style="display: none">
                        <!-- 
                        <li class="selected"><a href="#" title="Alarms">My Home</a>|</li>    
                        <li><a href="Submit_Ticket.jsp" title="Event Logs">Submit Request</a>|</li>
                        <li><a href="#" title="Sys Logs">View Request</a>|</li>
                        <li><a href="#" title="">Preferences</a>|</li>
                        <li><a href="#" title="">Sign In</a>|</li>
                        <li><a href="#" title="">Sign Out</a>|</li>
                        <li><a href="#" title="">SLA Violated Request</a></li>
                        --> 
                    </ul>

                    <ul id="faultSM" style="display: none">
                        <li  ${sessionScope.MAINMENU_SUB_ID eq 'sub_menu_alarms' ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_alarms" title="<%=toptable_i18n.tr("Alarms")%>"><%=toptable_i18n.tr("Alarms")%></a>|</li>
                            <%
                                String bsm_module = "sub_menu_eventlog";
                                if (isPluginInstalled) {
                                    bsm_module = "sub_menu_eventlog_new";
                                }%>
                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_eventlog' || sessionScope.MAINMENU_SUB_ID eq 'sub_menu_eventlog_new') ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=<%=bsm_module%>" title="<%=toptable_i18n.tr("Event Logs")%>"><%=toptable_i18n.tr("Event Logs")%></a>|</li>
                            <%
                                bsm_module = "sub_menu_syslog";
                                if (isPluginInstalled) {
                                    bsm_module = "sub_menu_syslog_new";
                                }%>
                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_syslog' || sessionScope.MAINMENU_SUB_ID eq 'sub_menu_syslog_new') ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=<%=bsm_module%>" title="<%=toptable_i18n.tr("Syslog")%>"><%=toptable_i18n.tr("Syslog")%></a>|</li>
                            <%  bsm_module = "sub_menu_snmptraps";  %>
                            <%  if (isPluginInstalled) {
                                    bsm_module = "sub_menu_snmptraps_new";
                                    separator = "|";
                                }%>
                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_snmptraps' || sessionScope.MAINMENU_SUB_ID eq 'sub_menu_snmptraps_new') ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=<%=bsm_module%>" title="<%=toptable_i18n.tr("SNMP Traps")%>"><%=toptable_i18n.tr("SNMP Traps")%></a><%=separator%></li>
                            <%    if (separator.equals("|")) {%>
                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_applicationlog' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_applicationlog" title="<%=toptable_i18n.tr("Application Log")%>"><%=toptable_i18n.tr("Application Log")%></a></li>
                            <%  }%>
                    </ul>

                    <ul id="performanceSM" style="display: none">
                        <%
                            int allow = (Integer) session.getAttribute("CHECKE_ACCESS_TOPTABLE_60");
                            int allowNodeAccess = (int) session.getAttribute("ALLOW_PERFORMANCE_TAB");

                        %>
                        <c:if test="${ businessService eq 1 && sessionScope.CHECKE_ACCESS_TOPTABLE_60 eq 1 && sessionScope.ALLOW_PERFORMANCE_TAB eq 1}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_bsm' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_bsm" title="<%=toptable_i18n.tr("Business Service")%>"><%=toptable_i18n.tr("Business Service")%></a>|</li>
                            </c:if>
                            <c:if test="${ businessMap eq 1 && sessionScope.ALLOW_PERFORMANCE_TAB eq 1 && sessionScope.CHECKE_ACCESS_TOPTABLE_MAPS eq 1}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_map' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_map" title="<%=toptable_i18n.tr("Map View")%>"><%=toptable_i18n.tr("Map View")%></a>|</li>
                            </c:if>
                            <c:if test="${businessSLA eq 1 && sessionScope.CHECKE_ACCESS_TOPTABLE_60_3 eq 1 && sessionScope.ALLOW_PERFORMANCE_TAB eq 1}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_sladashboard' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_sladashboard" title="<%=toptable_i18n.tr("Business SLA")%>"><%=toptable_i18n.tr("Business SLA")%></a>|</li>
                            </c:if>
                            <c:if test="${ sessionScope.ALLOW_PERFORMANCE_TAB eq 1 && ((sessionScope.CHECKE_ACCESS_TOPTABLE_0_1 eq 1) || (sessionScope.CHECKE_ACCESS_TOPTABLE_6_DEFAULTOU_1613 eq 1) )}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_server' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_server" title="<%=toptable_i18n.tr("Server")%>"><%=toptable_i18n.tr("Server")%></a>|</li>
                            </c:if>
                            <c:if test="${sessionScope.ALLOW_PERFORMANCE_TAB eq 1 && sessionScope.CHECKE_ACCESS_TOPTABLE_9_63 eq 1}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_database' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_database" title="<%=toptable_i18n.tr("Database")%>"><%=toptable_i18n.tr("Database")%></a>|</li>
                            </c:if>

                        <c:if test="${ sessionScope.ALLOW_PERFORMANCE_TAB eq 1 && ((sessionScope.CHECKE_ACCESS_TOPTABLE_0_3 eq 1) || (sessionScope.CHECKE_ACCESS_TOPTABLE_DeviceGroupID_3 eq 1) )}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_device' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_device" title="<%=toptable_i18n.tr("Device")%>"><%=toptable_i18n.tr("Device")%></a>|</li>
                            </c:if>
                            <c:if test="${ sessionScope.ALLOW_PERFORMANCE_TAB eq 1}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_enterprise' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_enterprise" title="<%=toptable_i18n.tr("Enterprise")%>"><%=toptable_i18n.tr("Enterprise")%></a>|</li>
                            </c:if>
                            <c:if test="${ sessionScope.ALLOW_PERFORMANCE_TAB eq 1 && ((sessionScope.CHECKE_ACCESS_TOPTABLE_0_2 eq 1) || (sessionScope.CHECKE_ACCESS_TOPTABLE_DeviceGroupID_3 eq 1) )}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_ntw' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_ntw" title="<%=toptable_i18n.tr("Network")%>"><%=toptable_i18n.tr("Network")%></a>|</li>
                            </c:if>
                            <c:if test="${ sessionScope.ALLOW_PERFORMANCE_TAB eq 1 && sessionScope.CHECKE_ACCESS_TOPTABLE_9_67 eq 1}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_service' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_service"  title="<%=toptable_i18n.tr("Synthetic Transactions")%>"><%=toptable_i18n.tr("Synthetic Transactions")%></a>|</li>
                            </c:if>
                            <c:if test="${ sessionScope.ALLOW_PERFORMANCE_TAB eq 1 && sessionScope.CHECKE_ACCESS_TOPTABLE_pollergroupid_67_63_130_257 eq 1}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_app' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_app" title="<%=toptable_i18n.tr("Application")%>"><%=toptable_i18n.tr("Application")%></a>|</li>
                            </c:if>
                            <c:if test="${ sanFeature eq 1 && sessionScope.ALLOW_PERFORMANCE_TAB eq 1 && ((sessionScope.CHECKE_ACCESS_TOPTABLE_1_68 eq 1 ) || (sessionScope.CHECKE_ACCESS_TOPTABLE_1_100 eq 1 ) || (sessionScope.CHECKE_ACCESS_TOPTABLE_1_101 eq 1 ) )}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_storage' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_storage" title="<%=toptable_i18n.tr("Storage")%>"><%=toptable_i18n.tr("Storage")%></a>|</li>
                            </c:if>
                            <c:if test="${ sessionScope.CHECKE_ACCESS_TOPTABLE_8_USERID eq 1}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_cp' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_cp" title="<%=toptable_i18n.tr("Capacity Planning")%>"><%=toptable_i18n.tr("Capacity Planning")%></a>|</li>
                            </c:if>
                            <%
                                separator = "";
                                if (isPluginInstalled) {
                                    separator = "|";
                                }%>
                            <c:if test="${sessionScope.ALLOW_SHARE_BSM_TAB eq 1}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_dashboard' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_dashboard" title="<%=toptable_i18n.tr("My Dashboard")%>"><%=toptable_i18n.tr("My Dashboard")%></a><%=separator%></li>
                            </c:if>
                            <%  if (isPluginInstalled) {%>
                                <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_netflow' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_netflow" title="<%=toptable_i18n.tr("NetFlow")%>"><%=toptable_i18n.tr("NetFlow")%></a>|</li>
                                <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_sflow' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_sflow" title="<%=toptable_i18n.tr("SFlow")%>"><%=toptable_i18n.tr("SFlow")%></a></li>
                            <%  }%>
                    </ul>

                    <ul id="securitySM" style="display: none">
                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_patchmgmt' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_patchmgmt" title="<%=toptable_i18n.tr("Patch Management")%>"><%=toptable_i18n.tr("Patch Management")%></a>|</li>
                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_tasks' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_tasks" title="<%=toptable_i18n.tr("Automation Tasks")%>"><%=toptable_i18n.tr("Automation Tasks")%></a>|</li>
                        
                        <% if(processFlow == 1){ %>        
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_processflow' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_processflow" title="<%=toptable_i18n.tr("Process Flow")%>"><%=toptable_i18n.tr("Process Flow")%></a>|</li>
                        <%} %>
                        
                        <% if(policyAnalyzer == 1){ %>        
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_policy' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_policy" title="<%=toptable_i18n.tr("Policy Analyzer")%>"><%=toptable_i18n.tr("Policy Analyzer")%></a>|</li>
                        <%} %>
                        
                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_powermgmt' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_powermgmt" title="<%=toptable_i18n.tr("Power Management")%>"><%=toptable_i18n.tr("Power Management")%></a></li>
                            <c:choose>
                                <c:when test="${SYMANTEC_AV_COLLECTION eq 1}">
                                <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_symantec' ) ? 'class="selected"' : ''}>|<a href="reDirectionPage.do?subModule=sub_menu_symantec" title="<%=toptable_i18n.tr("Antivirus Details")%>"><%=toptable_i18n.tr("Antivirus Details")%></a></li>
                                </c:when>
                                <c:when test="${SYMANTEC_AV_COLLECTION eq 2}">
                                <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_mcafee' ) ? 'class="selected"' : ''}>|<a href="reDirectionPage.do?subModule=sub_menu_mcafee" title="<%=toptable_i18n.tr("Antivirus Details")%>"><%=toptable_i18n.tr("Antivirus Details")%></a></li>
                                </c:when>
                            </c:choose>
                                
                        <% if(folderBackUp==1){ %>             
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_agent_backup' ) ? 'class="selected"' : ''}>|<a href="reDirectionPage.do?subModule=sub_menu_backup" title="<%=toptable_i18n.tr("Backup Details")%>"><%=toptable_i18n.tr("Backup Details")%></a></li> 
                         <%} %>  
                            
                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_agent_tasks' ) ? 'class="selected"' : ''}>|<a href="reDirectionPage.do?subModule=sub_menu_agent_tasks" title="<%=toptable_i18n.tr("USB Whitelisting")%>"><%=toptable_i18n.tr("USB Whitelisting")%></a></li>
                        
                        <% if(osDeployement==1){ %>
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_os_deployment' ) ? 'class="selected"' : ''}>|<a href="reDirectionPage.do?subModule=sub_menu_os_deployment" title=<%=toptable_i18n.tr("OS Deployment")%>><%=toptable_i18n.tr("OS Deployment")%></a></li>
                        <%}%>
                            
                            <c:if test="${sessionScope.SIMS_INSTALL_TYPE ne '3' && sessionScope.ALLOW_USER_ACCESS_ID eq '1'}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_operation_dashboard' ) ? 'class="selected"' : ''}>|<a href="reDirectionPage.do?subModule=sub_menu_operation_dashboard" title="<%=toptable_i18n.tr("Operations Dashboard")%>"><%=toptable_i18n.tr("Operations Dashboard")%></a></li>
                            </c:if>
                    </ul>
                    <ul id="inventorySM" style="display: none">
                        <c:if test="${sessionScope.ALLOW_Inventory_TAB eq 1 || sessionScope.ALLOW_Compliance_View_TAB eq 1 || sessionScope.ALLOW_Compliance_Operations_TAB eq 1 }">
                            <c:if test="${sessionScope.ALLOW_Inventory_TAB eq 1}">
                                <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_disc' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_disc"  title="<%=toptable_i18n.tr("Discovery")%>"><%=toptable_i18n.tr("Discovery")%></a>|</li>
                                <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_inve' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_inve" title="<%=toptable_i18n.tr("Summary")%>"><%=toptable_i18n.tr("Summary")%></a>|</li>
                                <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_resource' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_resource" title="<%=toptable_i18n.tr("Resource")%>"><%=toptable_i18n.tr("Resource")%></a>|</li>
                                <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_spview' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_spview" title="<%=toptable_i18n.tr("Switch Port")%>"><%=toptable_i18n.tr("Switch Port")%></a>|</li>
                                    <c:choose>
                                        <c:when test="${sessionScope.SIMS_INSTALL_TYPE eq '3'}" >
                                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_logical' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_logical" title="<%=toptable_i18n.tr("Organization Unit")%>"><%=toptable_i18n.tr("Organization Unit")%></a>|</li>
                                        </c:when>
                                        <c:otherwise>
                                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_logical' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_logical&isServer=yes" title="<%=toptable_i18n.tr("Organization Unit")%>"><%=toptable_i18n.tr("Organization Unit")%></a>|</li>  
                                        </c:otherwise>
                                    </c:choose>
                                </c:if>
                                <c:if test="${sessionScope.ALLOW_Compliance_View_TAB eq 1}">
                                <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_Compliance' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_Compliance"  title="<%=toptable_i18n.tr("Compliance")%>"><%=toptable_i18n.tr("Compliance")%></a><%=showSymbol%></li>
                                </c:if>
                                <c:if test="${sessionScope.ALLOW_Inventory_TAB eq 1}">
                                <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_Software' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_Software"  title="<%=toptable_i18n.tr("Installed Software")%>"><%=toptable_i18n.tr("Installed Software")%></a>|</li>
                                <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_SoftwareMetering' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_SoftwareMetering"  title="<%=toptable_i18n.tr("Software Metering")%>"><%=toptable_i18n.tr("Software Metering")%></a>|</li>
                                <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_vmview' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_vmview" title="<%=toptable_i18n.tr("Virtual Machine")%>"><%=toptable_i18n.tr("Virtual Machine")%></a>|</li>
                                <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_topoview' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_topoview" title="<%=toptable_i18n.tr("Topology Maps")%>"><%=toptable_i18n.tr("Topology Maps")%></a>|</li>
                                
                                <% if(applicationdiscover == 1){ %>
                                    <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_addm' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_addm" title="<%=toptable_i18n.tr("Application Discovery")%>"><%=toptable_i18n.tr("Application Discovery")%></a>|</li>
                                <%} %>
                                    <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_chnl' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_chnl" title="<%=toptable_i18n.tr("Change Logs")%>"><%=toptable_i18n.tr("Change Logs")%></a>|</li>
                                    <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_cloud' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_cloud" title="<%=toptable_i18n.tr("Cloud Discovery")%>"><%=toptable_i18n.tr("Cloud Discovery")%></a>|</li>
                                    <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_cloud_Native_discovery' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_cloud_Native_discovery" title="<%=toptable_i18n.tr("Cloud Native Discovery")%>"><%=toptable_i18n.tr("Cloud Native Discovery")%></a>|</li>
                                    <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_ssl_Certificates' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_ssl_Certificates" title="<%=toptable_i18n.tr("SSL Certificates")%>"><%=toptable_i18n.tr("SSL Certificates")%></a></li>
                                </c:if>
                        </c:if>
                    </ul>

                </c:if>
                    <ul id="reportsSM" style="display: none">
<c:choose>
    <c:when test="${ sessionScope.SEPARATE_REPORTING_SERVER == 1 && sessionScope.inReportingServer != 1}">
                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_invassetreport' ) ? 'class="selected"' : ''}><a style="text-transform: none" target="_blank" href="${ sessionScope.redirectReportUrl }ITAM_OLD_UI_REPORTsub_menu_invassetreport" title="<%=toptable_i18n.tr("Asset and Inventory Reports")%>"><%=toptable_i18n.tr("Asset and Inventory Reports")%></a>|</li>
                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_itautomationreport' ) ? 'class="selected"' : ''}><a target="_blank" href="${ sessionScope.redirectReportUrl }ITAM_OLD_UI_REPORTsub_menu_itautomationreport" title="<%=toptable_i18n.tr("IT Automation Reports")%>"><%=toptable_i18n.tr("IT Automation Reports")%></a>|</li>
                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_sysreport' ) ? 'class="selected"' : ''}><a target="_blank" href="${ sessionScope.redirectReportUrl }ITAM_OLD_UI_REPORTsub_menu_sysreport" title="<%=toptable_i18n.tr("Monitoring Reports")%>"><%=toptable_i18n.tr("Monitoring Reports")%></a>|</li>
                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_sutreport' ) ? 'class="selected"' : ''}><a target="_blank" href="${ sessionScope.redirectReportUrl }ITAM_OLD_UI_REPORTsub_menu_sutreport" title="<%=toptable_i18n.tr("Availability Reports")%>"><%=toptable_i18n.tr("Availability Reports")%></a>|</li>
                        <% if (businessSLA == 1) {%>
                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_slareport' ) ? 'class="selected"' : ''}><a target="_blank" href="${ sessionScope.redirectReportUrl }ITAM_OLD_UI_REPORTsub_menu_slareport" title="<%=toptable_i18n.tr("Business SLA Reports")%>"><%=toptable_i18n.tr("Business SLA Reports")%></a>|</li>
                         <%}%>
                         <% if (isPluginInstalled) {%>
                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_loganalreport' ) ? 'class="selected"' : ''}><a target="_blank" href="${ sessionScope.redirectReportUrl }ITAM_OLD_UI_REPORTsub_menu_loganalreport" title="<%=toptable_i18n.tr("Log Analyzer Reports")%>"><%=toptable_i18n.tr("Log Analyzer Reports")%></a>|</li>
                            <%}%>
                            <c:if test="${sessionScope.ALLOW_MIS_Reports_TAB eq 1}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_misreport' ) ? 'class="selected"' : ''}><a target="_blank" href="${ sessionScope.redirectReportUrl }ITAM_OLD_UI_REPORTsub_menu_misreport" title="<%=toptable_i18n.tr("MIS Reports")%>"><%=toptable_i18n.tr("MIS Reports")%></a>|</li>
                            </c:if>
                            <c:if test="${sessionScope.ALLOW_Scheduled_Reports_TAB eq 1}">
                            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_schedreport' ) ? 'class="selected"' : ''}><a target="_blank" href="${ sessionScope.redirectReportUrl }ITAM_OLD_UI_REPORTsub_menu_schedreport" title="<%=toptable_i18n.tr("Scheduled Reports")%>"><%=toptable_i18n.tr("Scheduled Reports")%></a>|</li>
                            </c:if>
                        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_offreport' ) ? 'class="selected"' : ''}><a target="_blank" href="${ sessionScope.redirectReportUrl }ITAM_OLD_UI_REPORTsub_menu_offreport" title="<%=toptable_i18n.tr("Offline Reports")%>"><%=toptable_i18n.tr("Offline Reports")%></a></li>
    </c:when>
    <c:otherwise>
        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_invassetreport' ) ? 'class="selected"' : ''}><a style="text-transform: none" href="reDirectionPage.do?subModule=sub_menu_invassetreport" title="<%=toptable_i18n.tr("Asset and Inventory Reports")%>"><%=toptable_i18n.tr("Asset and Inventory Reports")%></a>|</li>
        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_itautomationreport' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_itautomationreport" title="<%=toptable_i18n.tr("IT Automation Reports")%>"><%=toptable_i18n.tr("IT Automation Reports")%></a>|</li>
        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_sysreport' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_sysreport" title="<%=toptable_i18n.tr("Monitoring Reports")%>"><%=toptable_i18n.tr("Monitoring Reports")%></a>|</li>
        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_sutreport' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_sutreport" title="<%=toptable_i18n.tr("Availability Reports")%>"><%=toptable_i18n.tr("Availability Reports")%></a>|</li>
        <% if (businessSLA == 1) {%>
        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_slareport' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_slareport" title="<%=toptable_i18n.tr("Business SLA Reports")%>"><%=toptable_i18n.tr("Business SLA Reports")%></a>|</li>
        <%}%>
        <% if (isPluginInstalled) {%>
        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_loganalreport' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_loganalreport" title="<%=toptable_i18n.tr("Log Analyzer Reports")%>"><%=toptable_i18n.tr("Log Analyzer Reports")%></a>|</li>
        <%}%>
        <c:if test="${sessionScope.ALLOW_MIS_Reports_TAB eq 1}">
            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_misreport' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_misreport" title="<%=toptable_i18n.tr("MIS Reports")%>"><%=toptable_i18n.tr("MIS Reports")%></a>|</li>
        </c:if>
        <c:if test="${sessionScope.ALLOW_Scheduled_Reports_TAB eq 1}">
            <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_schedreport' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_schedreport" title="<%=toptable_i18n.tr("Scheduled Reports")%>"><%=toptable_i18n.tr("Scheduled Reports")%></a>|</li>
        </c:if>
        <li ${(sessionScope.MAINMENU_SUB_ID eq 'sub_menu_offreport' ) ? 'class="selected"' : ''}><a href="reDirectionPage.do?subModule=sub_menu_offreport" title="<%=toptable_i18n.tr("Offline Reports")%>"><%=toptable_i18n.tr("Offline Reports")%></a></li>

    </c:otherwise>
</c:choose>
                    </ul>

                </div>
                <div id='subNavigationAlert' style="text-align: right;vertical-align: middle">
                    <c:if test="${sessionScope.MAINMENU_ID eq 'main_menu_cmdb'}">
                        <div id="assetSearchDiv" style="display:block;">
                            <input id="footerSearchText" name="footerSearchText" type='text' class='mcopy' size='10' value="-- Search --" onFocus="javascript:if (document.getElementById('footerSearchText').value == '-- Search --') {
            document.getElementById('footerSearchText').value = '';
        }" onBlur="javascript:if (document.getElementById('footerSearchText').value == '') {
                    document.getElementById('footerSearchText').value = '-- Search --';
                }"  onKeyDown="if (event.keyCode == 13) {
                            goSearchFunction('<%=Base64.encode(AssetModule_ID)%>');
                        }"/>  <img src="img/footersearch.png" border="0" style="cursor: pointer" onclick="goSearchFunction('<%=Base64.encode(AssetModule_ID)%>');"/>&nbsp;
                            <a href="#"><img src="defaultServiceDesk_home.png" style="vertical-align:middle; height: 16px; width: 16px;" border='0'title="<%=toptable_i18n.tr("Set default CMDB home page")%>" alt="Set default CMDB home page" onclick="setDefaultCMDBHomePage()"/></a>
                        </div>
                    </c:if>
                    <c:if test="${(sessionScope.ALLOW_FAULT_TAB eq 1) && ((sessionScope.MAINMENU_ID eq 'main_menu_perf' ) || (sessionScope.MAINMENU_ID eq 'main_menu_reports' ) || (sessionScope.MAINMENU_ID eq 'main_menu_fault' ) )}">
                        <div id="alarmsDiv" style="display:block"></div> 
                    </c:if>
                </div></div>
        </div>
    </div>
</div>
<script>
    <c:if test="${(sessionScope.ALLOW_FAULT_TAB eq 1) && ((sessionScope.MAINMENU_ID eq 'main_menu_perf' ) || (sessionScope.MAINMENU_ID eq 'main_menu_reports' ) || (sessionScope.MAINMENU_ID eq 'main_menu_fault' ) )}">
    reloadAlerts("${_csrf.token}");
        <%
            int intervalTime = NumberUtils.toInt(configSettingServiceTopTable.findBySettingKey("ALARM_COUNT_REFRESH_INTERVAL"));
        %>
        <%  if (intervalTime > 0) {%>
    var interval =<%=intervalTime%>;
    interval = interval * 60000;
    setInterval("reloadAlerts('${_csrf.token}');", interval);
        <%}  %>
    </c:if>
</script>
<%
    } catch (Exception ex) {

        System.out.println("In toptable.jsp");
        ex.getStackTrace();
        StackTraceElement[] stackTrace = null;
        stackTrace = ex.getStackTrace();
        System.out.println("In toptable.jsp :: " + ex.getMessage());
        for (int i = 0; i < stackTrace.length; i++) {
            System.out.println(" ---- " + stackTrace[i].toString());
        }
    }
%>
<%@ include file="settingsNewUIIncludes.jsp" %>