<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="true"%>
<%@ 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" %>
<!DOCTYPE html>
<html lang="ko">
<head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
	<meta http-equiv="content-language" content="ko">
	<meta http-equiv="X-UA-Compatible" content="IE=9,chrome=1" />
	<title><spring:message code="sys.name" /></title>
   	<script type="text/javascript" src="/js/lib/jquery-1.12.4.min.js"></script>
	<script type="text/javascript" src="/js/lib/jquery-ui.min.js"></script>
	<link type="text/css" rel="stylesheet" href="/css/login_new.css">
	<link type="text/css" rel="stylesheet" href="/css/lib/jquery-ui.css">
</head>

<body>
<form:form name="detailForm" action="/j_spring_security_check" onsubmit="return fn_egov_login();">
    <div id="wrap">
    
 	<div id="dialog-confirm" style="display: none;">
            <p style="margin-top : 10px">- 사이버외사정보시스템 홈페이지는 IE 8버전 이상에 최적화 되어있습니다.</p>
            <p style="margin-top : 10px">- 홈페이지의 내용이 깨지는 현상이 발생하신다면, 아래 'Internet Explorer 9-32bit'또는<br /> 'Internet Explorer 9-64bit' 를 클릭하여 설치하여 주시기 바랍니다.</p>
            <p style="margin-top : 10px">- 1. 개인컴퓨터 운영체제 버전 확인하기.</p>
            <p style="margin-top : 10px">- 2. 설치방법'을 확인하시고 다운을 받기 바랍니다.</p>
            <p style="margin-top : 10px">- 감사합니다</p>
            <p style="margin-top : 30px"><a href="#" id="first-confirm" style="font-weight : 600; text-decoration : underline;">1. 개인컴퓨터 운영체제 버전 확인하기</a></p>
            <p style="margin-top : 10px"><a href="#" id="second-confirm" style="font-weight : 600; text-decoration : underline;">2. 설치방법</a></p>

            <ol>
                <li><a href="/images/IE9-Windows7-x86-kor.exe">Internet Explorer 9-32bit</a></li>
                <li><a href="/images/IE9-Windows7-x64-kor.exe" class="bordernone">Internet Explorer 9-64bit</a></li>
            </ol>
            <div id="first-confirm-popup" style="display : none;">
                    <img src="/images/new/popup01.jpg" alt="">
            </div>
            <div id="second-confirm-popup" style="display : none;">
                <img src="/images/new/popup02.jpg" alt="">
            </div>
        </div><!--end of popuplayer-->
        
        <h2 class="sr_only">통합홈페이지입니다.</h2>
        <div class="mVisual_img">
            <ul>
                <li class="img01">img1</li>
                <li class="img02">img2</li>
            </ul>
        </div><!--end of mVisual -->

        <div class="inner">
            <div class="loginBox">
                <div class="loginBox_TopBar"><!--상단 버튼-->
                    <ul class="clearfix">
                        <li class="on"><a href="#" class="on">외사정보시스템</a></li>
                        <li><a href="<spring:message code="Url.IMIS.loginProc" />">국제해양정보시스템</a></li>
                    </ul>
                </div><!-- end of loginBox_TopBar -->
                <div class="loginBox_BotBar">
                <input type=hidden name=login_error value="${login_error}" />
                    <div class="ocean">
                        <div class="hellow">
                            <h3>반갑습니다</h3>
                            <p class="hellow_name">이곳은 외사정보시스템입니다</p>
                        </div><!--end of hellow -->
                        <div class="id_pw">
                            <div class="id_section"><!--아이디 input-->
                                <ul class="clearfix">
                                    <li>
                                        아이디
                                    </li>
                                    <li class="id_val">
                                        <input type="text" name="j_username" maxlength="16" title="id" placeholder="아이디를 입력하세요."/>
                                    </li>
                                </ul>
                            </div><!--end of id_section-->
                            <div class="pw_section"><!--패스워드 input-->
                                <ul class="clearfix">
                                    <li>
                                        패스워드
                                    </li>
                                    <li>
                                        <input type="password" class="PW_val" name="j_password" placeholder="패스워드를 입력하세요.">
                                    </li>
                                </ul>
                            </div><!--end of pw_section-->
                        </div><!--end of id_pw-->
                        <div class="remember_id"> <!--아이디 저장하기 버튼-->
                            <input type="checkbox" class="check_id" name="remember_id" value="">
                            <label for="c1">
                                <span>아이디 저장하기</span>
                            </label>
                        </div><!--end of remember_id -->
                        <div class="login_Sign"> <!--로그인, 회원가입 버튼-->
                            <div class="login">
                                <!-- <a href="#">로그인</a> -->
                                <input type="submit" title="submit" class="login-btn" value="<spring:message code="member.login" />"/>
                            </div><!-- end of login -->
                        </div><!--end of login_Sign-->
                        <p class="logo">logo</p><!--하단 로고 deco-->
                    </div><!-- end of ocean -->

                </div><!-- end of loginBox_BotBar -->

            </div><!--end of loginBox-->

        </div><!--end of inner -->
        <div id="footer">
            <div class="inner clearfix">
                <h1>logo</h1>
                <address>
                    <div class="topic">
                        외사 및 국제 정보시스템
                    </div>
                    <div class="f_info">
                        <ul>
                            <li>
                                <!-- 30128 세종특별자치시 정부2청사로 13 (나성동) TEL 044-205-2469 | FAX 044-205-8995 -->
                                <spring:message code="sys.footer.address" />
                            </li>
                            <li>
                                COPYRIGHT(C)2011 MINISTRY OF REPUBLIC ADMINISTRATION AND SECURITY. ALL RIGHT RESERVED
                            </li>
                        </ul>
                    </div><!--end of f_info -->
                    <div class="w3c">w3c</div>
                </address>
            </div><!--end of inner -->
        </div>
    </div><!--end of wrap-->
    </form:form>
    
  <script type="text/javascript">
   
       $(document).ready(function(){
           var $img = $(".mVisual_img ul li");
           var nowIdx = 0;
           var oldIdx = nowIdx;
           // console.log($img.length)

            function nextFnc() {


                $img.eq(nowIdx).stop().fadeIn(600);
                $img.eq(oldIdx).stop().fadeOut(600);

                oldIdx = nowIdx;
            }

            function nextIdx() {
                if(nowIdx == $img.length-1) {
                    nowIdx = 0
                }else {
                    nowIdx++
                }
            }

            function start() {
                setInterval(function(){
                    nextFnc();
                    nextIdx();
                    // console.log(nowIdx)
                },4000)
            }

            $(document).ready(function(){
                nowIdx = $img.index($(this));
                $img.hide().eq(0).show();
                start();

            })
            
            // ContextMenu 방지 코드
			$(document).contextmenu(function(){
				return false;
			});
            
            
            document.detailForm.j_username.focus();
            
    	   	var error = document.detailForm.login_error.value;
    		if(error == 1){
    			alert('${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message}');
    		}
    		

    		$(".clse").on("click", function(){
                $("#popuplayer").hide();
            })
            
            var version = get_version_of_IE();
            if(version > -1 && version < 8){
            	 $( "#dialog-confirm" ).dialog({
                     resizable: false,
                     height: "auto",
                     width: 650,
                     modal: true,
                     buttons: {
                       "닫기": function() {
                         $( this ).dialog( "close" );
                       }
                     }
                   });
            }
           
         	   
              $("#first-confirm").on("click", function() {
                  $( "#first-confirm-popup" ).dialog({
                    resizable: false,
                    height: 800,
                    width: 850,
                    modal: true,
                    buttons: {
                      "닫기": function() {
                        $( this ).dialog( "close" );
                      }
                    }
                  });
              })
              
               $("#second-confirm").on("click", function(){
                 $( "#second-confirm-popup" ).dialog({
                   resizable: false,
                   height: 750,
                   width: 850,
                   modal: true,
                   buttons: {
                     "닫기": function() {
                       $( this ).dialog( "close" );
                     }
                   }
                 });
             })
             
       });
       
     
   	/* 로그인 function */
		function fn_egov_login() {
			mberId = document.detailForm.j_username.value;
			password = document.detailForm.j_password.value;
			
			if(mberId == "" && password == ""){
				alert("<spring:message code="member.blankBoth" />");
				return false;
			}else if(mberId != "" && password == ""){
				document.detailForm.j_password.focus();
				alert("<spring:message code="member.blankPass" />");
				return false;
			}else if(password != "" && mberId == ""){
				document.detailForm.j_username.focus();
				alert("<spring:message code="member.blankId" />");
				return false;
			}
			
			return true;
		}
   	
		function get_version_of_IE() { 
			 var word; 
			 var agent = navigator.userAgent.toLowerCase(); 
			 // IE old version ( IE 10 or Lower ) 
			 if ( navigator.appName == "Microsoft Internet Explorer" ) word = "msie "; 
			 // IE 11 
			 else if ( agent.search( "trident" ) > -1 ) word = "trident/.*rv:"; 
			 // Microsoft Edge  
			 else if ( agent.search( "edge/" ) > -1 ) word = "edge/"; 
			 // 그외, IE가 아니라면 ( If it's not IE or Edge )  
			 else return -1; 
			 var reg = new RegExp( word + "([0-9]{1,})(\\.{0,}[0-9]{0,1})" ); 
			 if (  reg.exec( agent ) != null  ) return parseFloat( RegExp.$1 + RegExp.$2 ); 
			 return -1; 
		} 
   </script>
       
</body>

</html>
