
// ログイン処理
function login_back() {

    // パラメータ取得
    strUserCode = document.getElementsByName("user_code")[0].value;
    strPassword = document.getElementsByName("password")[0].value;

    // 必須チェック
    if (strUserCode == "") {
        alert("ユーザIDが入力されていません。");
        return;
    }

    // 必須チェック
    if (strPassword == "") {
        alert("パスワードが入力されていません。");
        return;
    }

    // ログイン処理
    $.post("http://qooker.jp/QA/asynchronous.php?act=Login", {"user_code" : strUserCode, "password" : strPassword}, function(strResult) {
        if (strResult == "login successfully") {
            window.location.href='https://qooker.jp/QA/Q000300/MENU/';
        } else if (strResult == "lock password") {
            alert("3回間違えましたので、パスワードをロックします。");
            window.location.href='https://qooker.jp/QA/Q000101/INPUT/';
        } else {
            alert(strResult);
        }
    });

}

// ログイン処理
function login() {

    // パラメータ取得
    strUserCode = document.getElementsByName("user_code")[0].value;
    strPassword = document.getElementsByName("password")[0].value;

    // 必須チェック
    if (strUserCode == "") {
        alert("ユーザIDが入力されていません。");
        return;
    }

    // 必須チェック
    if (strPassword == "") {
        alert("パスワードが入力されていません。");
        return;
    }

    // URL設定
    var strURL = "https://qooker.jp/QA/jsonp.php";

    // パラメータ設定
    var strParam = "?act=Login";
    strParam += "&user_code=" + encodeURIComponent(strUserCode);
    strParam += "&password=" + encodeURIComponent(strPassword);

    // キャッシュ設定
    var strNoCacheIE = "&noCacheIE=" + (new Date()).getTime();

    // スクリプト生成
    var objScript = document.createElement("script");
    objScript.language = "javascript";
    objScript.type = "text/javascript";
    objScript.charset = "utf-8";
    objScript.src = strURL + strParam + strNoCacheIE;

    document.body.appendChild(objScript);
}

// ログイン後処理
function logined(strResult) {

    if (strResult == "login successfully") {
        window.location.href='https://qooker.jp/QA/Q000300/MENU/';
    } else if (strResult == "lock password") {
        alert("3回間違えましたので、パスワードをロックします。");
        window.location.href='https://qooker.jp/QA/Q000101/INPUT/';
    } else {
        alert(strResult);
    }

}

// ログイン後処理
function alertMessage(strMessage) {

    alert(strMessage);
}
