<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>

<script>
$(document).ready(function() {
	
	$("a[data-reqLogin='true']").each(function() {
		
		<sec:authorize access="not isAuthenticated()">
		this.onclick = function() {
			alert("로그인하신 후, 이용 가능합니다.");
		};
		</sec:authorize>
		
        <sec:authorize access="isAuthenticated()">
        this.onclick = function() {
            var gotoUrl = $(this).attr("data-gotoUrl");
            if(fn_isEmpty(gotoUrl)) {
            	alert("접속 정보가 없습니다. \n관리자에게 문의하여 주시기 바랍니다.");
            } else {
            	location.href = gotoUrl;
            }
        };
        </sec:authorize>
	});
	
});
</script>

        <div class="inner">
            <sec:authorize access="isAuthenticated()">
            <div class="left is_login">
                <button id="mo_alram_icon" type="button" class="noti-btn" onclick="javascript:location.href='${pageContext.request.contextPath}/cmm/listNotifications.do';"><img src="/images/icon/icon-alram.png" alt="alram" /></button>
                <span class="line"></span>
                <button type="button" class="member-btn" onclick="fn_getMemberCard();"><img src="/images/icon/icon-member-mo.png" alt="member" />회원증</button>
            </div>
            </sec:authorize>
            
            <div class="right">
                <button id="mo_search_icon" type="button"><img src="/images/icon/icon-data-search-white.png" alt="search" /></button>
                <button id="primary-nav-button" type="button" class="Btn eff"><i class="eff">Menu</i></button>
            </div>
            <nav id="primary-nav" class="dropdown cf">
                <ul class="dropdown menu">
                    <li><a href="javascript:void(0)" onclick="javascript:location.href='${pageContext.request.contextPath}/inform/selectGreeting.do';" title="자료관안내" class="eff">자료관안내</a>
                        <ul class="sub-menu">
                            <li><a href="javascript:void(0)" onclick="gfn_gotoUrl('${pageContext.request.contextPath}/inform/selectGreeting.do')" title="인사말"><span class="underline blue">인사말</span></a></li>
                            <li><a href="javascript:void(0)" onclick="gfn_gotoUrl('${pageContext.request.contextPath}/inform/selectNCultureOperationInfo.do')" title="이용안내"><span class="underline blue">이용안내</span></a></li>
                            <li><a href="javascript:void(0)" onclick="gfn_gotoUrl('${pageContext.request.contextPath}/inform/selectNCultureLocationInfo.do')" title="찾아오시는길"><span class="underline blue">찾아오시는길</span></a></li>
                        </ul>
                    </li>
                    <li><a href="javascript:void(0)" onclick="javascript:location.href='${pageContext.request.contextPath}/search/searchList.do';" title="소장자료" class="eff">소장자료</a></li>
                    
                    <li><a href="javascript:void(0)" onclick="javascript:location.href='${pageContext.request.contextPath}/bbs/listAncmnts.do';"  title="고객지원" class="eff">고객지원</a>
                        <ul class="sub-menu">
                            <li><a href="javascript:void(0)" onclick="gfn_gotoUrl('${pageContext.request.contextPath}/bbs/listAncmnts.do')" title="공지사항"><span class="underline blue">공지사항</span></a></li>
                            <li><a href="javascript:void(0)" onclick="gfn_gotoUrl('${pageContext.request.contextPath}/bbs/listFaqs.do')" title="FAQ"><span class="underline blue">FAQ</span></a></li>
                            <li><a href="javascript:void(0)" onclick="gfn_gotoUrl('${pageContext.request.contextPath}/bbs/listQnas.do')" title="Q&amp;A"><span class="underline blue">Q&amp;A</span></a></li>
                        </ul>
                    </li>

                    <li><a href="javascript:void(0)" data-gotoUrl="${pageContext.request.contextPath}/userInfo/getMyHome.do" title="마이페이지" class="eff" data-reqLogin="true">마이페이지</a>
                        <ul class="sub-menu">
                            <li><a href="javascript:void(0)" data-gotoUrl="${pageContext.request.contextPath}/userInfo/pwCertMyInfo.do" title="회원정보관리" data-reqLogin="true"><span class="underline blue">회원정보관리</span></a></li>
                            <li><a href="javascript:void(0)" data-gotoUrl="${pageContext.request.contextPath}/interest/listInterests.do" title="관심자료" data-reqLogin="true"><span class="underline blue">관심자료</span></a></li>
                            <li><a href="javascript:void(0)" data-gotoUrl="${pageContext.request.contextPath}/rent/listRentItems.do" title="대출관리" data-reqLogin="true"><span class="underline blue">대출관리</span></a></li>
                            <li><a href="javascript:void(0)" data-gotoUrl="${pageContext.request.contextPath}/read/listReadItems.do" title="방문열람관리" data-reqLogin="true"><span class="underline blue">방문열람관리</span></a></li>
                        </ul>
                    </li>                    
                </ul>
            </nav>
        </div>
        
        <div class="mo-nav-wrap">
        	<div class="login_box">
            	<h2>로그인하여 <br />더 많은 정보를 확인해 보세요</h2>
                    <div class="btns_box">
                        <sec:authorize access="not isAuthenticated()">
                        <button type="button" class="btn_login login-btn" onclick='fn_layerPopWithClass("/login/loginFormPopup.do", "pop-login")'>로그인</button>
                        </sec:authorize>

                        <sec:authorize access="isAuthenticated()">
                        <button type="button" class="btn_login login-btn" onclick="javascript:location.href='${pageContext.request.contextPath}/logout';">로그아웃</button>
                        </sec:authorize>
                        
                        <button type="button"  onclick="javascript:location.href='${pageContext.request.contextPath}/cart/listCartItems.do';">카트</button>
                    </div>
                </div>
                <div class="menu_box">
                    <ul class="mo_dropdown">
                        <li class="mo_menu">
                            <a href="javascript:void(0)" onclick="javascript:location.href='/';" title="홈">
                                <div class="wrap">
                                    <div class="name">홈</div>
                                    <div class="drop_icon"></div>
                                </div>
                            </a>
                        </li>
                        <li class="mo_menu">
                            <div class="wrap">
                                <div class="name">자료관안내</div>
                                <div class="drop_icon"></div>
                            </div>
                            <ul class="sub-menu">
	                            <li><a href="javascript:void(0)" onclick="gfn_gotoUrl('${pageContext.request.contextPath}/inform/selectGreeting.do')" title="인사말"><span class="underline blue">- 인사말</span></a></li>
	                            <li><a href="javascript:void(0)" onclick="gfn_gotoUrl('${pageContext.request.contextPath}/inform/selectNCultureOperationInfo.do')" title="이용안내"><span class="underline blue">- 이용안내</span></a></li>
	                            <li><a href="javascript:void(0)" onclick="gfn_gotoUrl('${pageContext.request.contextPath}/inform/selectNCultureLocationInfo.do')" title="찾아오시는길"><span class="underline blue">- 찾아오시는길</span></a></li>
                            </ul>
                        </li>
                        <li class="mo_menu">
                            <a href="javascript:void(0)" onclick="gfn_gotoUrl('${pageContext.request.contextPath}/search/searchList.do')" title="소장자료">
                                <div class="wrap">
                                    <div class="name">소장자료</div>
                                    <div class="drop_icon"></div>
                                </div>
                            </a>
                        </li>
                        <li class="mo_menu">
                            <div class="wrap">
                                <div class="name">고객지원</div>
                                <div class="drop_icon"></div>
                            </div>
                            <ul class="sub-menu">
                                <li><a href="javascript:void(0)" onclick="gfn_gotoUrl('${pageContext.request.contextPath}/bbs/listAncmnts.do')" title="공지사항"><span class="underline blue">- 공지사항</span></a></li>
                                <li><a href="javascript:void(0)" onclick="gfn_gotoUrl('${pageContext.request.contextPath}/bbs/listFaqs.do')" title="FAQ"><span class="underline blue">- FAQ</span></a></li>
                                <li><a href="javascript:void(0)" onclick="gfn_gotoUrl('${pageContext.request.contextPath}/bbs/listQnas.do')" title="Q&amp;A"><span class="underline blue">- Q&amp;A</span></a></li>
                            </ul>
                        </li>
                        <li class="mo_menu">
                            <div class="wrap">
                                <div class="name">마이페이지</div>
                                <div class="drop_icon"></div>
                            </div>
                            <ul class="sub-menu">
                                <li><a href="javascript:void(0)" data-gotoUrl="${pageContext.request.contextPath}/userInfo/pwCertMyInfo.do" title="회원정보관리"><span class="underline blue">- 회원정보관리</span></a></li>
                                <li><a href="javascript:void(0)" data-gotoUrl="${pageContext.request.contextPath}/interest/listInterests.do" title="관심자료"><span class="underline blue">- 관심자료</span></a></li>
                                <li><a href="javascript:void(0)" data-gotoUrl="${pageContext.request.contextPath}/rent/listRentItems.do" title="대출관리"><span class="underline blue">- 대출관리</span></a></li>
                                <li><a href="javascript:void(0)" data-gotoUrl="${pageContext.request.contextPath}/read/listReadItems.do" title="방문열람관리"><span class="underline blue">- 방문열람관리</span></a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
                <div class="menu_bg"></div>
            </div>
        
