<!doctype html>
<html lang="ko">
<head>
    <meta charset="utf-8">
    <meta name="naver-site-verification" content="894ba0807460988349b1e131377b26966e347fc1"/>
    <meta name="google-site-verification" content="CitaOJM4btglyBtNxZFYymBBzh3g7Pb9PxKl9YF8jDg" />
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta property="fb:app_id" content="961578337335000" />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="https://crossmap.co.kr/web/register" />
    <meta property="og:title" content="크로스맵 (회원가입) - 기독교 종합 포털" />
    <meta property="og:description" content="크로스맵은 일상 속에서 은혜를 구하는 크리스천을 위한 기독교 종합 포털사이트입니다." />
    <meta property="og:image" content="https://crossmap.co.kr" />
    <meta name="description" content="크로스맵은 일상 속에서 은혜를 구하는 크리스천을 위한 기독교 종합 포털사이트입니다.">
    <meta name="keywords" content="크로스맵 회원가입">
    <title>크로스맵 (로그인) - 기독교 종합 포털</title>
    <link rel="shortcut icon" href="/img/shortcut_icon.png">
    <link rel="apple-touch-icon" href="/img/shortcut_icon.png">
    <link rel="apple-touch-startup-image" href="/img/shortcut_icon.png">
    <link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon" />

    <!-- css -->
    <link rel="stylesheet" href="/renew/css/main.css">
    <link rel="stylesheet" href="/renew/css/popup.css">
    <!-- Font -->
    <link href="https://fonts.googleapis.com/css?family=Nanum+Gothic" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Nanum+Myeongjo" rel="stylesheet"> 
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">

    <script src="/js/jquery-3.3.1.min.js"></script>
    <script src="/js/web/common.js?1546309261"></script>
    <script src="/js/web/jquery.vticker.min.js"></script>
    <script src="//developers.kakao.com/sdk/js/kakao.min.js"></script>
    <script type="text/javascript" src="/smarteditor/js/HuskyEZCreator.js" charset="utf-8"></script>
    <!-- <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({
        google_ad_client: "ca-pub-7071495522658800",
        enable_page_level_ads: true
     });
    </script> -->
    <!-- <script type="text/javascript">
    var mobile_keys = new Array('iPhone','iPod','iPad','Android','BlackBerry','Windows Phone','Windows CE','LG','MOT','SAMSUNG','SonyEricsson','Nokia');
    if(document.URL.match('pc_screen')) mobile_keys = null;
    for(i in mobile_keys){
        if(navigator.userAgent.match(mobile_keys[i]) != null){
        location.href = "/m/";
        break;
        }
    }
    </script> -->
</head>

<body>
    

<script>
// 로그인
function main_login_proc(){
    if($("#main_login_member_id").val()=="") {
        alert("아이디를 입력해주세요.");
        return false;
    }
    if($("#main_login_member_pwd").val()=="") {
        alert("아이디를 입력해주세요.");
        return false;
    }

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

    var form_data = {
        "member_id"     : $("#main_login_member_id").val(),
        "member_pwd"    : $("#main_login_member_pwd").val(),
        "save_login"    : save_login
    };
    $.ajax({
        url: '/web/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="<?php echo $this->input->server('HTTP_REFERER')?>";
            } else {
                alert(rtnJson.msg);
                return false;
            }
        },
        error: function (rtnJson) {
            alert('로그인에 실패했습니다.');
            return false;
        }
    });
}


// This is called with the results from from FB.getLoginStatus().
function statusChangeCallback(response) {
    if (response.status === 'connected') {
        FB.api('/me', function(response) {
            if(response.id!='') {
                var form_data = {
                    "id"            : response.id,
                    "name"          : response.name
                };
                $.ajax({
                    url: '/web/share/facebook_login_proc',
                    async: false,
                    type: 'POST',
                    dataType: 'JSON',
                    data: form_data,
                    success: function (rtnJson) {
                        if (rtnJson.code == "0000") {
                            window.location.reload();
                        } else {
                            alert("페이스북 로그인에 실패했습니다.");
                            return false;
                        }

                    },
                    error: function (rtnJson) {
                        return false;
                    }
                });
            }
        });
    }
}

function checkLoginState() {
    window.FB.login(function(response) {
        console.log(response);
        if (response.status === 'connected') {
            statusChangeCallback(response);
        }
    });
}


window.fbAsyncInit = function() {
    FB.init({
        appId      : '961578337335000',
        cookie     : true,  // enable cookies to allow the server to access
        xfbml      : true,  // parse social plugins on this page
        version    : 'v2.8' // use graph api version 2.8
    });
};
// Load the SDK asynchronously
(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "https://connect.facebook.net/en_US/sdk.js";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

</script>
<iframe id="kmc_mobile_auth" src="/web/comm/kmc_mobile_auth" style="width:0px;height:0px;position:absolute; top:0; left:-9999px;" ></iframe>

<!-- Default Statcounter code for Crossmap.co.kr
http://crossmap.co.kr -->
<script type="text/javascript">
var sc_project=10767957; 
var sc_invisible=1; 
var sc_security="0cf2c0fe"; 
</script>
<script type="text/javascript"
src="https://www.statcounter.com/counter/counter.js"
async></script>
<noscript><div class="statcounter"><a title="Web Analytics"
href="https://statcounter.com/" target="_blank"><img
class="statcounter"
src="//c.statcounter.com/10767957/0/0cf2c0fe/1/" alt="Web
Analytics"></a></div></noscript>
<!-- End of Statcounter Code -->

<script language='javascript'>
    var _AceGID=(function(){var Inf=['gtp13.acecounter.com','8080','AH5A41707571392','AW','0','NaPm,Ncisy','ALL','0']; var _CI=(!_AceGID)?[]:_AceGID.val;var _N=0;var _T=new Image(0,0);if(_CI.join('.').indexOf(Inf[3])<0){ _T.src =( location.protocol=="https:"?"https://"+Inf[0]:"http://"+Inf[0]+":"+Inf[1]) +'/?cookie'; _CI.push(Inf);  _N=_CI.length; } return {o: _N,val:_CI}; })();
    var _AceCounter=(function(){var G=_AceGID;var _sc=document.createElement('script');var _sm=document.getElementsByTagName('script')[0];if(G.o!=0){var _A=G.val[G.o-1];var _G=(_A[0]).substr(0,_A[0].indexOf('.'));var _C=(_A[7]!='0')?(_A[2]):_A[3];var _U=(_A[5]).replace(/\,/g,'_');_sc.src=(location.protocol.indexOf('http')==0?location.protocol:'http:')+'//cr.acecounter.com/Web/AceCounter_'+_C+'.js?gc='+_A[2]+'&py='+_A[4]+'&gd='+_G+'&gp='+_A[1]+'&up='+_U+'&rd='+(new Date().getTime());_sm.parentNode.insertBefore(_sc,_sm);return _sc.src;}})();
</script>
<noscript><img src='http://gtp13.acecounter.com:8080/?uid=AH5A41707571392&je=n&' border='0' width='0' height='0' alt=''></noscript> 
<!-- AceCounter Log Gathering Script End -->

<!-- 로그인 -->
<div id="login_layer" style="display:block;">
<div class="popup_wrap">
    <div class="popupbox">
        <div class="popuptop2 ">
           <div class="logo"><a href="/"><img src="/renew/img/logo-b.gif" alt="크로스맵"></a></div>
        </div>
        <div class="popupbody">
            <form name="login_form" id="login_form" method="post" action="/web/member/login_proc">
            <div class="p_login">
                <fieldset>
                    <div class="input_box">
                        <input type="text" name="login_member_id" id="login_member_id" class="int" placeholder="아이디를 입력하세요.">
                    </div>
                    <div class="input_box">
                        <input type="password" name="login_member_pwd" id="login_member_pwd" class="int" placeholder="비밀번호를 입력하세요"  onkeypress="if( event.keyCode==13 ){login_proc();}">
                    </div>

                </fieldset>
                <div class="chk_id_login">
                    <input type="checkbox" name="save_login" id="save_login" value="Y" style="margin-right:5px;">로그인 상태 유지
                    <span style="float:right;"><a href="/web/user/find_id">아이디</a>/ <a href="/web/user/find_password">비밀번호 찾기</a><span><img src="/renew/img/mypage_bar.gif" alt="" style="padding:0 8px;"></span><a href="/web/user/register">회원가입</a></span>
                </div>
            </div>

            <div class="form-group" style="margin:10px 0 20px 0; padding-bottom: 20px; display:block; text-align:center">
                <button type="button" class="btn br5 m_email" onclick="login_proc();" >로그인  </button>
            </div>
            </form>
        </div>
    </div>

</div>
</div>
<!--// 로그인 -->

<script>
$(document).ready(function() {

});

$(".mask").on('click', function(event){
    $(event.target).parent().hide();

});

function check_password(){
    if($("#profile_password").val()==""){
        alert("비밀번호를 입력해주세요.");
        return false;
    }

    var form_data = {
        "member_id"     : "",
        "member_pwd"    : $("#profile_password").val()
    };
    $.ajax({
        url: '/web/member/password_check_proc',
        async: false,
        type: 'POST',
        dataType: 'JSON',
        data: form_data,
        success: function (rtnJson) {
            console.log(rtnJson);
            console.log(rtnJson.code);
            if (rtnJson.code == "0000") {
                location.href="/web/mypage/member_edit";
            } else {
                alert(rtnJson.msg);
                return false;
            }
        },
        error: function (rtnJson) {
            alert('비밀번호 확인에 실패했습니다.');
            return false;
        }
    });
}

//url parameter 가져오기
function getQuerystring(paramName){ 
    if(window.location.search!=""){
        var _tempUrl = window.location.search.substring(1); //url에서 처음부터 '?'까지 삭제 
        var _tempArray = _tempUrl.split('&'); // '&'을 기준으로 분리하기 
        for(var i = 0; _tempArray.length; i++) { 
            var _keyValuePair = _tempArray[i].split('='); // '=' 을 기준으로 분리하기 
            if(_keyValuePair[0] == paramName){ // _keyValuePair[0] : 파라미터 명 // _keyValuePair[1] : 파라미터 값 
                return _keyValuePair[1]; 
            } 
        } 
    }else{
        return "";
    }
}


// 로그인
function login_proc(){
    if($("#login_member_id").val()=="") {
        alert("아이디를 입력해주세요.");
        return false;
    }
    if($("#login_member_pwd").val()=="") {
        alert("아이디를 입력해주세요.");
        return false;
    }

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

    var form_data = {
        "member_id"     : $("#login_member_id").val(),
        "member_pwd"    : $("#login_member_pwd").val(),
        "url"           : getQuerystring("url"),
        "save_login"    : save_login
    };
    $.ajax({
        url: '/web/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);
                }
                if(rtnJson.url==""){
                    location.href="<?php echo $this->input->server('HTTP_REFERER')?>";
                }else{
                    location.href=rtnJson.url;
                }
            } else {
                alert(rtnJson.msg);
                return false;
            }
        },
        error: function (rtnJson) {
            alert('로그인에 실패했습니다.');
            return false;
        }
    });
}

function join_reset(){
    if($("#login_layer").css("display") == "block") {
        $("#login_layer").hide();
    }

    $('#join_form')[0].reset();
    $("#member_pwd").removeClass('mybutton_on');
    $("#member_pwd").removeClass('mybutton_off');
    $("#member_pwd").addClass('mybutton_off');
    $("#re_member_pwd").removeClass('mybutton_on');
    $("#re_member_pwd").removeClass('mybutton_off');
    $("#re_member_pwd").addClass('mybutton_off');

    $("#gender_btn1").removeClass('btn-default_bb');
    $("#gender_btn1").removeClass('btn-default');
    $("#gender_btn1").addClass('btn-default');

    $("#gender_btn2").removeClass('btn-default_bb');
    $("#gender_btn2").removeClass('btn-default');
    $("#gender_btn2").addClass('btn-default');

    $(".profile_add_photo label").css("background","url('img/img_photo.png') no-repeat center");
    $(".profile_add_photo label").css("background-size","cover");
}


// 크로스맵으로 가입
function crossmap_join(){
    join_reset();
    commonLayerClose('member_join1_layer');
    commonLayerOpen('member_join2_layer');
}

// 트위터로 가입
function twitter_join(val){
   join_reset();
    var form_data = {
        "type"          : val
    };
    $.ajax({
        url: '/web/comm/twitter_request_token',
        async: false,
        type: 'POST',
        dataType: 'JSON',
        data: form_data,
        success: function (rtnJson) {
            if (rtnJson.result_code == "0000") {
                var url = rtnJson.result_data.url;
                console.log(url);
                window.open(url, "", "height=500,width=400,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes");

            } else {
                alert("트위터 계정인증에 실패했습니다.");
                return false;
            }
        },
        error: function (rtnJson) {
            alert('트위터 계정인증에 실패했습니다.');
            return false;
        }
    });
}

//  카카오로 가입
function kakako_login(){
    join_reset();

    var state = "61e0276330e9f515a169ca77dda4a833";
    var url = "https://kauth.kakao.com/oauth/authorize?client_id=d9d530edc95295682137fdd37dddc55f&redirect_uri=https://crossmap.co.kr/web/share/kakao_callback_proc&response_type=code&state="+state;
    window.open(url, "", "height=500,width=400,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes");
}

// 네이버로 가입
function naver_login(){
    join_reset();

    var state = "61e0276330e9f515a169ca77dda4a833";
    var url = "https://nid.naver.com/oauth2.0/authorize?response_type=code&client_id=cNiinVHYsygxVKF4FOtw&redirect_uri=https://crossmap.co.kr/web/share/naver_callback_proc&state="+state;
    window.open(url, "", "height=500,width=400,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes");
}


// 비밀번호 체크
function member_pwd_check(t){
    var id  = t.id;
    var val = t.value;

    $("#"+id).removeClass('mybutton_off');
    if(member_pwd_valid_check(val)==false) {
        $("#"+id).addClass('mybutton_off');
    } else {
        $("#"+id).addClass('mybutton_on');
    }
}


// This is called with the results from from FB.getLoginStatus().
function statusChangeCallback(response) {
    if (response.status === 'connected') {
        FB.api('/me', function(response) {
            if(response.id!='') {
                var form_data = {
                    "id"            : response.id,
                    "name"          : response.name
                };
                $.ajax({
                    url: '/web/share/facebook_login_proc',
                    async: false,
                    type: 'POST',
                    dataType: 'JSON',
                    data: form_data,
                    success: function (rtnJson) {
                        if (rtnJson.code == "0000") {
                            window.location.reload();
                        } else {
                            alert("페이스북 로그인에 실패했습니다.");
                            return false;
                        }

                    },
                    error: function (rtnJson) {
                        return false;
                    }
                });
            }


        });
    }
}

function checkLoginState() {
    window.FB.login(function(response) {
        console.log(response);
        if (response.status === 'connected') {
            statusChangeCallback(response);
        }
    });
}


window.fbAsyncInit = function() {
    FB.init({
        appId      : '961578337335000',
        cookie     : true,  // enable cookies to allow the server to access
        xfbml      : true,  // parse social plugins on this page
        version    : 'v2.8' // use graph api version 2.8
    });
};
// Load the SDK asynchronously
(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "https://connect.facebook.net/en_US/sdk.js";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));


</script>
    <script>
function getCookie( name ) {
   var nameOfCookie = name + "=";
   var x = 0;
   while ( x <= document.cookie.length )
   {
       var y = (x+nameOfCookie.length);
       if ( document.cookie.substring( x, y ) == nameOfCookie ) {
           if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
               endOfCookie = document.cookie.length;
           return unescape( document.cookie.substring( y, endOfCookie ) );
       }
       x = document.cookie.indexOf( " ", x ) + 1;
       if ( x == 0 )
           break;
   }
   return "";
}
</script>


</body>
</html>
