<%@ 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"%>
<%@ page import="java.lang.String" %>
<%@ page import="org.springframework.security.ui.AbstractProcessingFilter" %>
<%@ page import="org.springframework.security.AuthenticationException" %>

<%
 /**
  * Class Name : EgovCvplLogin.jsp
  * Description : Civil Appeal Sample Login page
  * Modification Information
  * 
  *   수정일         수정자                   수정내용
  *  -------    --------    ---------------------------
  *  2009.02.01   박소윤         최초 생성
  *
  * author 실행환경 개발팀 박소윤
  * since 2009.02.01
  *  
  * Copyright (C) 2009 by MOPAS  All right reserved.
  */
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="<c:url value='/css/egovframework/egovCvpl.css'/>" />
<title><spring:message code="pageTitle.egovCvplLogin" /></title>
<%
    String login_error = (String)request.getParameter("login_error");
%>
<script type="text/javaScript" language="javascript" defer="defer" src="<c:url value='/js/egovframework/rte/cvpl/cvpluser_cmmn.js'/>"></script>
<script type="text/javaScript" language="javascript" defer="defer">
<!--
function fn_egov_login() {
	if(FormValidation(document.loginForm) != false) {
	    document.loginForm.action="<c:url value='/j_spring_security_check'/>";
	    document.loginForm.flag.value = "L";
	    document.loginForm.submit();
	}
}

function fn_egov_add_cvpluser() {	
	document.loginForm.action = "<c:url value='/cvpl/addCvplUserLoginView.do'/>";
    document.loginForm.submit();
}

-->
</script>
</head>

<body>
<form name="loginForm"  action="<c:url value='/j_spring_security_check'/>">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="100%" height="100%" align="center" valign="middle" style="padding-top:150px;"><table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="<spring:message code='image.loginBg' />"><table border="0" cellspacing="3" cellpadding="0">
      <tr>
        <td><img src="<c:url value='/images/egovframework/rte/'/><spring:message code='image.loginId' />" height="20"></td>
        <td>
		   <input type='text' size='17' name='j_username' <c:if test="${not empty param.login_error}">value='<c:out value="${SPRING_SECURITY_LAST_USERNAME}"/>'</c:if>
					 class='txt' style='width:180px; height:19px' required fieldTitle='ID' maxLength='10' tabIndex="1">          
		   </input>
        </td>
        <td rowspan="2"><a href="javascript:fn_egov_login();"><img src="<c:url value='/images/egovframework/rte/'/><spring:message code='image.login' />" width="70" height="45" border="0" tabIndex="3" ></a></td>
      </tr>
      <tr>
        <td><img src="<c:url value='/images/egovframework/rte/'/><spring:message code='image.loginPw' />" height="20"></td>
        <td>
			<input type="password" name="j_password" class="txt" style="width:180px; height:19px" required fieldTitle="Password" maxLength="15"  tabIndex="2" onKeyPress="if(event.keyCode==13) fn_egov_login();">
		</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td height="30"><a href="javascript:fn_egov_add_cvpluser();"><b><spring:message code='button.addUser' /></b></a></td>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr> 
	<td width="200" height="50" colspan="4">
		<c:if test="${not empty param.login_error}">
		  <font color="red">
			Your login attempt was not successful, try again.<BR><BR>
			Reason: <%= ((AuthenticationException) session.getAttribute(AbstractProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %>
		  </font>
		</c:if>                 
	</td>
  </tr>
</table></td>
  </tr>
</table>
<!-- end of title -->
<input type="hidden" name="flag">
</form>
<script language="JavaScript">
document.loginForm.j_username.focus();
</script>
</body>
</html>