<%@ 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="form"      uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<script type="text/javaScript" type="text/javascript" defer="defer">
//<!--
	/* 글 목록 화면 function */
	function fn_selectList() {
	   	document.menuForm.action = "<c:url value='/notice/list.do'/>";
	   	document.menuForm.submit();
	}
   
    function fn_modify(){
	   	document.menuForm.action = "<c:url value='/notice/updateView.do'/>";
	   	document.menuForm.submit();
	}	
    function fn_delete(){
    	if (confirm("<spring:message code="confirm.msg.askDel" />")){
    		document.menuForm.action = "<c:url value='/notice/delete.do'/>";
    	   	document.menuForm.submit();	
    	}
	}
    
    function fn_reply(){
    	document.menuForm.action = "<c:url value='/notice/replyView.do'/>";
    	document.menuForm.npIdxGrp.value = document.menuForm.npIdx.value; 
	   	document.menuForm.submit();
    }
   
    $(document).ready(function(){
    	$("#content").keydown(function(e){
    		if (e.keyCode == 13) {
    			fn_comment_insert();
    			return false;
    		}
    	});
    });
//-->
</script>
<div id="table">
  	<table class="tbl_view">
  		<colgroup>
   			<col width="180"/>
   			<col width="320"/>
   			<col width="180"/>
   			<col width="320"/>
   		</colgroup>
 		<thead>
 			<tr>
	  			<th class="tbl_title" colspan="6" scope="row">
	  				<c:out value="${noticeVO.npSubject}"/>
	  			</th>
	  		</tr>
	  		<tr>
		  		<th><label for="hit">시작일</label></th>
  				<td class="view"><div><c:out value="${noticeVO.npStart}"/></div></td> 
		  		<th><label for="hit">종료일</label></th>
  				<td class="view"><div><c:out value="${noticeVO.npEnd}"/></div></td> 
  			</tr>
  			<tr>
		  		<th><label for="hit">너비</label></th>
  				<td class="view"><div><c:out value="${noticeVO.npWidth}"/></div></td> 
		  		<th><label for="hit">높이</label></th>
  				<td class="view"><div><c:out value="${noticeVO.npHeight}"/></div></td> 
  			</tr>
  			<tr>
		  		<th><label for="hit">사용여부</label></th>
  				<td class="view"><div><c:out value="${noticeVO.npActive}"/></div></td> 
		  		<th><label for="hit">등록일</label></th>
  				<td class="view"><div><c:out value="${noticeVO.npRegdate}"/></div></td> 
  			</tr>
 		</thead>
  		<tbody>
  			<tr class="tbl_content">
  				<td class="view" colspan="4"><div><c:out value="${noticeVO.npText}" escapeXml="false"/></div></td> 
  			</tr>
  		</tbody>
  	</table>
  <form:form commandName="noticeVO" name="menuForm" method="post">
  	<form:hidden path="npIdx" value="${noticeVO.npIdx}"/>
	<div class="boardviewinfo">
		<ul class="right btn-style">
			<c:if test="${noticeVO.prevSeq > 0}">
   			   	<li>
   			   		<a href="/notice/view.do?npIdx=<c:out value="${noticeVO.prevSeq}" />"><spring:message code="button.goPrev" /></a>
	            </li>
   			</c:if>
   			<c:if test="${noticeVO.nextSeq > 0}">
   			   	<li>
   			   		<a href="/notice/view.do?npIdx=<c:out value="${noticeVO.nextSeq}" />"><spring:message code="button.goNext" /></a>
	            </li>
   			</c:if>
   			<li>
   				<a href="javascript:fn_selectList();"><spring:message code="button.goList" /></a>
            </li>
            <c:if test="${loginUserVO ne null && (loginUserVO.isSysAdmin == true || loginUserVO.userid == noticeVO.npWriter)}">
   			<li>
   				<a href="javascript:fn_modify();"><spring:message code="button.goModify" /></a>                    
            </li>
   			<li>
   				<a href="javascript:fn_delete();"><spring:message code="button.goDelete" /></a>                   
            </li>
            </c:if> 
		</ul>	
	</div>
   	</form:form>
</div>