﻿

//判断是否已经登陆,loginType  1学员登陆，2机构登陆，3讲师登陆"欢迎您：" + UserName + "
function CheckLoginUser(loginType) {
    var spanShowPicTagAsLoginRemark = document.getElementById("spanShowPicTagAsLoginRemark");
    //如果当前浏览的页面只显示登陆、注册的文字
    if (spanShowPicTagAsLoginRemark == null || spanShowPicTagAsLoginRemark == undefined) { 
        var student = "http://student.px33.com/";
        var organ = "http://organ.px33.com/";
        var docent = "http://docent.px33.com/";
        var result = ""
        switch (loginType) {
            case 1: result = "<a href=\"" + student + "\logout.aspx\"><span id=\"spanTopBarAsLogout\" class=\"topBarAsLogout\" title=\"退出\">退出 </span>| </a> <a href=\"" + student + "/MngIndex.aspx\" target=\"_blank\"><span id=\"spanTopBarAsMngIndex\" class=\"topBarAsMngIndex\" title=\"管理后台\">管理后台 </span></a>";
                break;
            case 2: result = "<a href=\"" + organ + "\logout.aspx\"><span id=\"spanTopBarAsLogout\" class=\"topBarAsLogout\" title=\"退出\">退出 </span>| </a> <a href=\"" + organ + "/MngIndex.aspx\" target=\"_blank\"><span id=\"spanTopBarAsMngIndex\" class=\"topBarAsMngIndex\" title=\"管理后台\">管理后台 </span></a>";
                break;
            case 3: result = "<a href=\"" + docent + "\logout.aspx\"><span id=\"spanTopBarAsLogout\" class=\"topBarAsLogout\" title=\"退出\">退出 </span>| </a> <a href=\"" + docent + "/MngIndex.aspx\" target=\"_blank\"><span id=\"spanTopBarAsMngIndex\" class=\"topBarAsMngIndex\" title=\"管理后台\">管理后台 </span></a>";
                break;
        }
        if (result!="")
        document.getElementById("lbLoginMess").innerHTML = result;
    }
    else
    {
        CheckLoginUserAsIco(loginType);
    }
}

//判断是否已经登陆（文字前加图标）,loginType  1学员登陆，2机构登陆，3讲师登陆"欢迎您：" + UserName + "
function CheckLoginUserAsIco(loginType) {
    var student = "http://student.px33.com/";
    var organ = "http://organ.px33.com/";
    var docent = "http://docent.px33.com/";
    var result = ""
    switch (loginType) {
        case 1: result = "<a href=\"" + student + "\logout.aspx\"><span id=\"spanTopBarAsLogout\" class=\"topBarAsLogout\" title=\"退出\">" +
                "<img src=\"http://images.px33.com/image/TechnoCourse/Stop.gif\" width=\"13\" height=\"15\" border=\"0\"/>" +
                "退出 </span></a> <a href=\"" + student + "/MngIndex.aspx\" target=\"_blank\"><span id=\"spanTopBarAsMngIndex\" class=\"topBarAsMngIndex\" title=\"管理后台\">" +
                "<img src=\"http://images.px33.com/image/TechnoCourse/pic_2.gif\" width=\"13\" height=\"15\" border=\"0\"/>管理后台 </span></a>";
            break;
        case 2: result = "<a href=\"" + organ + "\logout.aspx\"><span id=\"spanTopBarAsLogout\" class=\"topBarAsLogout\" title=\"退出\">" +
                "<img src=\"http://images.px33.com/image/TechnoCourse/Stop.gif\" width=\"14\" height=\"15\" border=\"0\"/>" +
                "退出 </span></a> <a href=\"" + organ + "/MngIndex.aspx\" target=\"_blank\"><span id=\"spanTopBarAsMngIndex\" class=\"topBarAsMngIndex\" title=\"管理后台\">" +
                "<img src=\"http://images.px33.com/image/TechnoCourse/pic_2.gif\" width=\"14\" height=\"15\" border=\"0\"/>管理后台 </span></a>";
            break;
        case 3: result = "<a href=\"" + docent + "\logout.aspx\"><span id=\"spanTopBarAsLogout\" class=\"topBarAsLogout\" title=\"退出\">" +
                "<img src=\"http://images.px33.com/image/TechnoCourse/Stop.gif\" width=\"14\" height=\"15\" border=\"0\"/>" +
                "退出 </span></a> <a href=\"" + docent + "/MngIndex.aspx\" target=\"_blank\"><span id=\"spanTopBarAsMngIndex\" class=\"topBarAsMngIndex\" title=\"管理后台\">" +
                "<img src=\"http://images.px33.com/image/TechnoCourse/pic_2.gif\" width=\"14\" height=\"15\" border=\"0\"/>管理后台 </span></a>";
            break;
    }
    if (result != "")
        document.getElementById("lbLoginMess").innerHTML = result;
}

