<%@page import="com.eactive.eai.rms.common.acl.menu.ui.MenuUI"%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ page import="com.eactive.eai.rms.common.acl.menu.MenuRenderController"%>
<%@page import="com.eactive.eai.rms.common.login.SessionManager"%>
<%@page import="com.eactive.eai.rms.common.util.CommonConstants"%>
<%@page import="com.eactive.eai.rms.common.util.StringUtils"%>
<%@page  import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.HashMap"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String menuId = (String) request.getAttribute("menuId");
    String menuName = (String) request.getAttribute("menuName");
	List<MenuUI> list = (List<MenuUI>) request.getAttribute("leftMenuList");
%>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<script language="javascript" src="<c:url value="/js/jquery-1.12.1.min.js"/>"></script>    
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/web_ui.css"/>" />
	<link rel="stylesheet" type="text/css" media="screen" href="<c:url value="/css/theme_${themeColor}.css"/>" />
    <script>
    
    var menuId = '<%=menuId%>';
    
    //메인 페이지 이동하기
    function goPage(pUrl, id) {
    	
        var pageUrl = pUrl;
        
    	if (pUrl.indexOf("?")>-1){
	    	pageUrl += "&";
    	}else{
	    	pageUrl += "?";
    	}
    	
    	pageUrl += "menuId="+id;
		pageUrl += "&serviceType="+sessionStorage["serviceType"];
        
        parent.mainFrame.location.href= pageUrl;
    }   
    
    $(document).ready(function(){
    	
    	$(".menuList").click(function() {
    		var menuListId = $(this).attr('id');
    		$(".menuList").removeClass('on');
    		$("#"+menuListId).addClass('on');
    	});
    	
    	if(menuId.substring(menuId.length-3, menuId.length)=='000') {
    		$(".menuList").first().addClass('on');
    	} else {
    		$("#"+menuId).addClass('on');
    	}
    	
    });
    
    
	</script>
</head>
<body>
	<div class="left_box">
		<!-- 메뉴명이 null일 경우 공백 노출되도록 처리 20251126 --> 
		<div class="title"><%=menuName != null ? menuName : ""%></div>
		<ul class="depth3">
	  	<%
               for (MenuUI menuUi : list) {
              %>
              <li id="<%=menuUi.getMenuId()%>" class="menuList"><a href="javascript:goPage('<%=menuUi.getMenuUrl()%>','<%=menuUi.getMenuId()%>');"><%=menuUi.getMenuName()%></a></li>
		     <%} %>
		</ul>
	</div><!-- end left_box -->
</body>	
</html>

