﻿/*
*/

/* 기본적으로 로그인 및 회원 관리 스크립트 */

var Login = function() {
    var email = document.getElementById('sUserId');
    var pwd = document.getElementById('sPassword');
    $.ajax(
    {
        type: "POST",
        url: '/_comm/_login.aspx',
        dataType: 'json',  
        data: {'mail': email.value , 'pwd': pwd.value},
        Error: function() 
        {
        },
        success:LoginSuc
});
}

//
var LoginPage = function() {
    
    var email = document.getElementById('userId');
    var pwd = document.getElementById('userPwd');
    $.ajax(
        {
            type: "POST",
            url: '/_comm/_login.aspx',
            dataType: 'json',
            data: { 'mail': email.value, 'pwd': pwd.value },
            Error: function() {
            },
            success: LoginSuc
        });
}

var LoginSuc = function(data) {
    if (data.errno == 0) {
        // 로그인 성공
        window.location.reload(true);
    } else {
        // 로그인 실패
    showBoardMsgbox('The email/password you have entered is not correct.<br/><br/>Your ID is your email address! Have you checked?');
        return false; 
    }
    return;
}