//-----------------------------------
//
// Ajax
//
//-----------------------------------
function login_check(){
            var url = '../login.php';
            var value = 'login';
            var data  = 'Processing=' + encodeURIComponent(value);
            data = data + data_create();
            sendRequest(url, writeData, 'POST', data);
};
//-----------------------------------
//
// Ajax Data Create
//
//-----------------------------------
function data_create(){
        var str = "";
        fObj = document.MyForm;

        value = fObj.email.value;
        str  = str +'&login_id=' + encodeURIComponent(value);

        value = fObj.login_pass.value;
        str  = str +'&login_pass=' + encodeURIComponent(value);

        return str;
};
//-----------------------------------
//
// After Ajax
//
//-----------------------------------
function writeData(req){
    fObj = document.MyForm;

    var str = req.responseText.split(",");

    if(str[0] == "login"){
            location.reload();

            return false;
    }
    else if(str[0] == "none"){

            Ext.MessageBox.show({
                title: '認証エラー',
                msg: 'ID、パスワードに誤りがございます。',
                buttons: Ext.MessageBox.OK,
                minWidth:200,
            icon: Ext.MessageBox.WARNING
            });

            return false;
    }
    else{
            Ext.MessageBox.show({
            title: '処理エラー',
            msg: req.responseText,
            buttons: Ext.MessageBox.OK,
            minWidth:200,
            icon: Ext.MessageBox.WARNING
            });
            return false;
    }
};

