<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@include file="/WEB-INF/jsp/common/taglibs.jspf" %>
<style type="text/css">
    .navbar-inverse {
        background-color: #3C8DBC;
        border-color: #3C8DBC;
    }

    .navbar-inverse .navbar-nav > li > a {
        color: #fff;
    }

    .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus {
        color: #F0F0F0;
        background-color: transparent;
    }

    .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus {
        color: #fff;
        background-color: #357CA5;
    }

    .dropdown-submenu {
        position: relative;
    }

    .navbar {
        border-radius: 0px;
    }

    .dropdown-submenu > .dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: -6px;
        margin-left: -1px;
        -webkit-border-radius: 0 0px 0px 0px;
        -moz-border-radius: 0 0px 0px;
        border-radius: 0 0px 0px 0px;
    }

    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
    }

    .dropdown-submenu > a:after {
        display: block;
        content: " ";
        float: right;
        width: 0;
        height: 0;
        border-color: transparent;
        border-style: solid;
        border-width: 5px 0 5px 5px;
        border-left-color: #ccc;
        margin-top: 5px;
        margin-right: -10px;
    }
</style>
<div class="navbar navbar-inverse">
    <div class="container" style="width: 1250px;"><!-- 删除多余菜单后把style删除即可 -->
        <div class="navbar-header">
            <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand hidden-sm" href="javascript:void(0);"><font style="color: #fff;font-weight: bold;">寿险17版反欺诈系统</font></a>
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <c:forEach items="${menuList}" var="m" varStatus="status">
                    <c:if test="${m.resParentId == 0}">
                        <li class="dropdown">
                            <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" style="width: 110px;"
                               data-target="#">${m.resName}<b class="caret">
                            </b></a>
                            <ul class="dropdown-menu">
                                <c:forEach items="${menuList}" var="s">
                                    <c:if test="${s.resParentId==m.resId}">
                                        <li>
                                            <c:if test="${s.resContent ne 'graph/index.do'}">
                                                <a href="<%=request.getContextPath()%>/menuForward.do?menuId=${s.resId}">${s.resName}</a>
                                            </c:if>

                                            <c:if test="${s.resContent eq 'graph/index.do'}">
                                                <a href="<%=request.getContextPath()%>/menuForward.do?menuId=${s.resId}" target="_blank">${s.resName}</a>
                                            </c:if>
                                        </li>
                                    </c:if>
                                </c:forEach>
                            </ul>
                        </li>
                    </c:if>
                </c:forEach>
            </ul>
            <ul class="nav navbar-nav  navbar-right">
                <li class="dropdown"><a href="javascript:void(0);">欢迎您：${user.userName}</a></li>
                <li>
                    <ul class="nav navbar-nav">
                        <li class="dropdown">
                            <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown"
                               data-target="#">用户管理
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <!-- <li>
                                    <a href="javascript:void(0)" onclick="forward(${user.userId})">密码修改</a>
                                </li> -->
                                <li><a href="javascript:window.open('', '_top', '').close();">关闭</a></li>
                                <%--<li><a href="<%=request.getContextPath()%>/logout.do">退出</a></li>--%>
                               <%-- <li><a href="javascript:window.open('logout.do', '_top');">退出</a></li>--%>
                                <%--<li><a href="javascript:window.opener = null;window.open('', '_top');window.top.close();">退出</a></li>--%>

   <%--                             <li><a href="javascript:window.open('', '_top');window.top.close();">退出</a></li>--%>

<%--                                <li><a href="javascript:window.open('', '_top', '').close();">退出</a></li>--%>
                                <%--<li><a href="javascript:window.open(location, '_self').close();">退出</a></li>--%>
                            </ul>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</div>
<div class="container-fluid" id="alert"></div>
<!-- dialog -->
<div class="modal fade" id="password-modal"></div>
<script type="text/javascript">
    //查看应用
    function forward(userId) {
        $("#password-modal").load("system/user/forwardResetPWD.do", {userId: userId}, function (mes) {
            $("#password-modal").modal("show");
        });
    }

    window.onbeforeunload = function(){
        clearCookie();
        window.location.replace('about:blank');
    }

    // 退出时关闭页面
    function closeWebPage(){
        clearCookie();
        window.location.replace('about:blank');
       var userAgent = navigator.userAgent;
       if (userAgent.indexOf("Firefox") != -1 || userAgent.indexOf("Chrome") !=-1) {
           clearCookie();
           window.location.href="/index.do";
           window.location.replace('about:blank');
       } else {
           window.opener = null;
           window.open("about:blank", "_self");
           window.close();
       }
    }

    function clearCookie(){
        var keys=document.cookie.match(/[^ =;]+(?=\=)/g);
        if (keys) {
            for (var i = keys.length; i--;)
                document.cookie=keys[i]+'=0;expires=' + new Date( 0).toUTCString()
        }
    }
</script>