function express_login() {
    $.ajax({
        url: "uc/login.php?mod=logined",
        type: "POST",
        dataType: 'html',
        timeout: 50000,
        cache: false,
        async: false,      //是否ajax同步
        success: function (data) {
            if (data == "True") {
                alert("已登录");
            } else {
                ShowLoginBox();
            }
        },
        error: function () {
            alert("服务器出错");
        }
    });
}

//显示ajax登录层，并告知服务器登录
function ShowLoginBox(func) {
    art.dialog.open('uc/login.php?mod=login', {
        id: "ajaxlogopage", title: '登录提示', lock: true, fixed: true, close: function () {
            var username=art.dialog.data("LoginName");
            if (username != undefined && username != "") {
                var htmlstr = "欢迎光临:"+username+"<a href=\"javascript:void(0);\" onclick=\"express_login();\" class=\"ml10\">安全退出</a>";
                $("#userlogin").html(htmlstr);
                var f = eval(func);
                if (typeof (f) != "undefined")
                    f;
            }
        }
    });
}
//安全退出函数，删除session
function loginout() {
    art.dialog({
        opacity: 0,
        lock: true,
        drag: false,
        resize: false,
        fixed: true,
        title: '安全退出',
        content: '请确定安全退出吗？',
        icon: 'warning',
        top: '0%',
        left: '90%',
        button: [
                   {
                       name: '安全退出',
                       callback: function () {
                           $.ajax({
                               url: "uc/login.php?mod=loginout",
                               type: "GET",
                               timeout: 3000,
                               success: function (data) {
                                   if (data == "1") {
                                       art.dialog({
                                           title: '安全退出',
                                           content: '您已安全退出',
                                           icon: 'succeed',
                                           time: 1,
                                           close: function () {
                                               window.location = "../index.htm";
                                           },
                                           lock: true,
                                           opacity: 0
                                       });
                                   }
                               },
                               error: function () {
                                   art.dialog.close();
                               }
                           });
                       },
                       focus: true
                   },
                   {
                       name: '取消',
                       callback: function () {
                           art.dialog.close();
                       },
                       focus: false
                   }
        ]
    });
}
//获取用户登录状态
function CheckLoginStatus() {
    var status = 0;
    $.ajax({
        url: "uc/login.php?mod=logined",
        type: "POST",
        dataType: 'html',
        timeout: 50000,
        cache: false,
        async: false,      //是否ajax同步
        success: function (data) {
            if (data == "True") {
                status = 1;
            } else {
                status = 0;
            }
        },
        error: function () {
            alert("服务器出错");
        }
    });
    return status;
}
//弹出登录界面
function LoginBox(CodeName) {
    art.dialog.open('uc/login.php?mod=login',
        {
            id: "LoginBox",
            title: '登录界面',
            ok: function () {

            },
            cancel: function () {

            },
            close: function () {
                var LoginName = art.dialog.data('LoginName');
                if (LoginName != "undefined" && LoginName != null && LoginName != "") {
                    art.dialog.tips("登陆成功", 3);
                    eval(CodeName+"()")
                } else {
                    return "0";
                }
            },
            width: 1000,
            height: 500
        }
    );
}
