<%--
  Class Name : EgovLoginUsr.jsp
  Description : 로그인화면
  Modification Information
 
      수정일         수정자                   수정내용
    -------    --------    ---------------------------
     2009.03.10    박지욱             최초 생성
     2011.08.31   JJY       경량환경 버전 생성
 
    author   : 공통서비스 개발팀  박지욱
    since    : 2009.03.10
--%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<!DOCTYPE html>
<html lang="ko">
<head>
<title>로그인</title>
<script type="text/javascript">
function press(event) { if (event.keyCode == 13) actionLogin(); }

function actionLogin() {
    if (document.loginForm.id.value =="") {
        alert("아이디를 입력하세요");
        return false;
    } else if (document.loginForm.password.value =="") {
        alert("비밀번호를 입력하세요");
        return false;
    } else {
        document.loginForm.action="<c:url value='/web/user/login/actionSecurityLogin.do'/>";
        <%-- document.loginForm.j_username.value = document.loginForm.userSe.value + document.loginForm.username.value;
        document.loginForm.action="<c:url value='/j_spring_security_check'/>"; --%>
        document.loginForm.submit();
    }
}

<%--
function setCookie (name, value, expires) {
    document.cookie = name + "=" + escape (value) + "; path=/; expires=" + expires.toGMTString();
}

function getCookie(Name) {
    var search = Name + "="
    if (document.cookie.length > 0) { // 쿠키가 설정되어 있다면
        offset = document.cookie.indexOf(search)
        if (offset != -1) { // 쿠키가 존재하면
            offset += search.length
            // set index of beginning of value
            end = document.cookie.indexOf(";", offset)
            // 쿠키 값의 마지막 위치 인덱스 번호 설정
            if (end == -1)
                end = document.cookie.length
            return unescape(document.cookie.substring(offset, end))
        }
    }
    return "";
}

function saveid(form) {
    var expdate = new Date();
    // 기본적으로 30일동안 기억하게 함. 일수를 조절하려면 * 30에서 숫자를 조절하면 됨
    if (form.checkId.checked)
        expdate.setTime(expdate.getTime() + 1000 * 3600 * 24 * 30); // 30일
    else
        expdate.setTime(expdate.getTime() - 1); // 쿠키 삭제조건
    setCookie("saveid", form.id.value, expdate);
}

function getid(form){
    form.checkId.checked = ((form.id.value = getCookie("saveid")) != "");
}
--%>
</script>

</head>

<body>
	<div id="contents">
		<div class="contentService">
			<h1>공예인력DB</h1>
		</div>
		
		<form:form id="loginForm" name="loginForm" method="post">
	    <input type="hidden" name="beforeUrl"  value='<c:out value="${beforeUrl}"></c:out>'/>
	    <input type="hidden" name="userSe"  value="USR"/>
		<div class="loginBox">
			<div class="img">
				<h2>공예인력DB시스템에 오신 것을 환영합니다</h2>				
			</div>
			<div class="set">
				<div class="logArea">
					<label for="userId">아이디</label><p><input type="text" id="id" name="id" class="inp" onkeypress="press(event);"/></p>
					<label for="userPw">비밀번호</label><p><input type="password" id="password" name="password" class="inp" autocomplete="off"  onkeypress="press(event);"/></p>
					<a href="javascript:actionLogin();"><span class="btnLogin">로그인</span></a>
				</div>
				<%-- <div class="logCau">
					<p>비밀번호를 5회 잘못 입력하셨습니다.<br />등록된 이메일로 임의 비밀번호를 발송 하였으니, 확인 해주세요.</p>
				</div> --%>
				<div class="logEx">
					<span><a href="/web/user/login/searchUsrId.do">아이디 찾기</a></span>
					<span><a href="/web/user/login/searchUsrPwd.do">비밀번호 찾기</a></span>
					<span><a href="/web/user/join/usrJoinIntro.do">공예DB등록</a></span>
				</div>
			</div>
		</div>
		</form:form>

	</div>
</body>
</html>

