
<?
$redir = isset($redir) ? $redir : "/m/";
?>
<script>

	function login_proc(){
		if($("#login_member_id").val()=="") {
			alert("아이디를 입력해주세요.");
			$("#login_member_id").focus();
			return false;
		}
		if($("#login_member_pwd").val()=="") {
			alert("비밀번호를 입력해주세요.");
			$("#login_member_pwd").focus();
			return false;
		}

		var save_login = 'N';
		if($('input:checkbox[id="save_login"]').is(":checked") == true){
			save_login = "Y"
		}

		var save_id = 'N';
		if($('input:checkbox[id="save_id"]').is(":checked") == true){
			save_id = "Y"
		}

		var form_data = {
			"member_id"     : $("#login_member_id").val(),
			"member_pwd"    : $("#login_member_pwd").val(),
			"save_login"    : save_login,
			"save_id" : save_id
		};
		$.ajax({
			url: '/m/member/login_proc',
			async: false,
			type: 'POST',
			dataType: 'JSON',
			data: form_data,
			success: function (rtnJson) {
				if (rtnJson.code == "0000") {
					if(rtnJson.msg!=''){
						alert(rtnJson.msg);
					}
					location.href="<?=$redir?>";

				} else if (rtnJson.code == "1111") {

					location.href="/m/member/change_pw?redir=<?=$redir?>";
				}
				else{
					alert(rtnJson.msg);
					return false;
				}
			},
			error: function (rtnJson) {
				alert('로그인에 실패했습니다.');
				return false;
			}
		});
	}

	function inputSendit() {
		if (event.keyCode == 13) {
			login_proc();
		}
	}

</script>

<?
$save_user_id = get_cookie("crossmap_save_login_id");
?>
<div class="main_header">
	<span class="header_tit"><img src="/img/mobile/img_logo.jpg"  style="margin:80px 0 170px 0;"></span><span class="fr" style="position:absolute; top:25px; right:25px;"><a href="/m/"><img src="/img/mobile/img_close.gif"></a></span>
	<div class="form-group2">
		<input type="id" id="login_member_id" class="form-control" placeholder="아이디를 입력해주세요." value="<?=get_cookie("crossmap_save_login_id");?>" style="width:98%;" onkeydown="inputSendit();">
	</div>
	<div class="form-group3">
		<input type="password" id="login_member_pwd" class="form-control" placeholder="비밀번호를 입력해주세요."style="width:98%;" onkeydown="inputSendit();">
	</div>
</div>
<div class="main_cont" style="top:250px;">
	<div class="form-group" style="margin:0px 0; display:block; text-align:center;     border-bottom: 0;">
		<button type="button" class="btn br5 m_email" style="padding:20px 0" onclick="login_proc();">로그인</button>
	</div>
	<div class="chk_id_login">
		<input value="" id="save_login" type="checkbox" style="margin-right:5px;">자동로그인
		<input value="" id="save_id" type="checkbox" style="margin-left:20px;margin-right:5px;" <?echo isset($save_user_id) ? "checked" : "";?> >아이디 저장
		<div><span class="beachblue" style="text-decoration: underline;"><a href="/m/member/find_id">아이디</a>/<a href="/m/member/find_pw">비밀번호</a></span>를 잊어버리셨나요?</div>
	</div>
<!--	<div class="form-group" style="margin:0px 0; display:block; text-align:center; border-bottom: 0; ">-->
<!--		<button type="button" class="btn br5 m_facebook" style="padding:17px 0">페이스북 계정으로 로그인하기</button>-->
<!--	</div>-->
<!---->
<!--	<div class="form-group" style="margin:0px 0; display:block; text-align:center; border-bottom: 0;">-->
<!--		<button type="button" class="btn br5 m_kakao" style="padding:17px 0">카카오톡 계정으로 로그인하기</button>-->
<!--	</div>-->
<!--	<div class="form-group" style="margin:0px 0; display:block; text-align:center; border-bottom: 0;">-->
<!--		<button type="button" class="btn br5 m_naver" style="padding:17px 0">네이버 계정으로 로그인하기 </button>-->
<!--	</div>-->
<!--	<div class="form-group" style="margin:0px 0; display:block; text-align:center; border-bottom: 0; ">-->
<!--		<button type="button" class="btn br5 m_tweeter" style="padding:17px 0">트위터 계정으로 로그인하기 </button>-->
<!--	</div>-->
	<div class="b_bottom"><a href="">처음 오셨나요?</a> <span class="b_login"><a href="/m/member/join">가입하기</a></span></div>
</div>

