<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%
    String basePath = request.getContextPath();
    String resourcePath = basePath + "/resource";
%>
<div class="top">
    <div class="top-main">
        <div class="top1">
            <img src="<%=resourcePath%>/images/share/logo.png" alt="">&nbsp;衡水大数据中心资源共享平台
        </div>
        <div class="top2">
            <span><a href="<%=basePath%>/" class="top2-a">首页</a></span>
            <span><a href="<%=basePath%>/share/data/index.htm" class="top2-a">共享目录</a></span>
            <span><a href="<%=basePath%>/share/dataRequirement/index.htm" class="top2-a">部门需求</a></span>
            <shiro:guest>
                <%--<a href="<%=basePath%>/share/account/login.htm" class="tx1">--%>
                <span><a href="javascript:void(0);"onclick="window.location.href='<%=basePath%>/share/account/login.htm'" class="top2-a">用户中心</a></span>
                <%--</a>--%>
            </shiro:guest>
            <shiro:authenticated>
                <%--<a  id="hiddenS" class="tx">--%>
                <span><a href="javascript:void(0);" onclick="window.location.href='<%=basePath%>/share/mydata/index.htm/1'" class="top2-a">用户中心</a></span>
                <%--</a>--%>
            </shiro:authenticated>
            <span class="sousuo">
                <input type="text" id="searchName" name="searchName"  placeholder="请输入要查找的内容">
                <img onclick="searchName()" src="<%=resourcePath%>/images/share/icon_sousuo.png" alt="" class="top2-img">
            </span>
            <shiro:guest>
                <%--<a href="<%=basePath%>/share/account/login.htm" class="tx1">--%>
                    <img class="tx1" onclick="window.location.href='<%=basePath%>/share/account/login.htm'" src="<%=resourcePath%>/images/share/icon_denglu.png" alt="">
                <%--</a>--%>
            </shiro:guest>
            <shiro:authenticated>
                <%--<a  id="hiddenS" class="tx">--%>
                    <img class="tx" onclick="showYonghu()" src="<%=resourcePath%>/images/share/touxiang.png" alt="">
                <%--</a>--%>
            </shiro:authenticated>
        </div>
        <div class="tuichutanchuang" hidden  id="yonghuzhongxin">
            <div class="yonghuzhongxin">
                <a href="<%=basePath%>/share/mydata/index.htm/1" class="yonghuzx-font">
                    <span class="icon1"></span>
                    用户中心
                </a>
            </div>
            <div class="yonghuzhongxin">
                <a href="<%=basePath%>/share/account/logout.action" class="tuichu-font">
                    <span class="icon20"></span>
                    退出
                </a>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function searchName() {
        var searchName = "" ;
        if(true/*$("#searchName").val()!=null&&$("#searchName").val()!=undefined*//*&&$("#searchName").val()!=""*/){
            searchName = "?searchName="+$("#searchName").val() ;
            window.location.href="<%=basePath%>/share/"+searchName ;
        }
    }

    function showYonghu() {
        $("#yonghuzhongxin").toggle() ;
    }

    function showSearchName() {
        var url = window.location.search;
        if (url.indexOf('?') < 0) { return false; }
        var name=url.substring(url.indexOf("=")+1)
        $('#searchName').val(decodeURI(name))
    }
    showSearchName()
</script>