function ShowTab(tabnum,page) {
    var divs = document.getElementsByTagName("div");
    for (var i = 0; i < divs.length; i++) {
        if (divs[i].className == "mytbFocus" || divs[i].className == "mytbNoFocus") {
            var divnum = divs[i].id.substring(3, 4);
            if (divnum == tabnum) {
                divs[i].className = "mytbFocus";
            } else {divs[i].className = "mytbNoFocus";}
        }
    }
    var rndcode = new Date().getTime();
    var XMLHttpRequestObject = createRequest();
    if (XMLHttpRequestObject) {
        var PutDiv = document.getElementById("showContent");
        PutDiv.innerHTML = "<div style='text-align:center;padding:100px 0px 0px 0px;'><img src='/App_Themes/ManagerTheme/images/WaitSave.gif' /><br /><br /><br /> 正在读取数据，请稍后...</div>";
        XMLHttpRequestObject.open("GET", "/ashx/AdminMain.ashx?ViewType=" + tabnum + "&Page=" + page + "&tmp=" + rndcode, true);         //异步
        XMLHttpRequestObject.setRequestHeader("Content-Type", "text/plain");
        XMLHttpRequestObject.send(null);
        XMLHttpRequestObject.onreadystatechange = function() {
            if (XMLHttpRequestObject.readyState == 4) {
                if (XMLHttpRequestObject.status == 200) {
                    var strState = XMLHttpRequestObject.responseText;
                    PutDiv.innerHTML = strState;
                } else {
                    PutDiv.innerHTML = "<div class='mytbContent' style='text-align:center;'>服务器繁忙，请稍后再试！</div>";
                }
            }
        };
    }
}

function inntContent() {
    var rndcode = new Date().getTime();
    var XMLHttpRequestObject = createRequest();
    if (XMLHttpRequestObject) {
        var PutDiv = document.getElementById("showContent");
        PutDiv.innerHTML = "<div style='text-align:center;padding:100px 0px 0px 0px;'><img src='/App_Themes/ManagerTheme/images/WaitSave.gif' /><br /><br /><br /> 正在读取数据，请稍后...</div>";
        XMLHttpRequestObject.open("GET", "/ashx/AdminMain.ashx?ViewType=0&Page=1&tmp=" + rndcode, true);         //异步
        XMLHttpRequestObject.setRequestHeader("Content-Type", "text/plain");
        XMLHttpRequestObject.send(null);
        XMLHttpRequestObject.onreadystatechange = function() {
            if (XMLHttpRequestObject.readyState == 4) {
                if (XMLHttpRequestObject.status == 200) {
                    var strState = XMLHttpRequestObject.responseText.split("{||}");
                    var sCount = strState[0].split(",");
                    var birCount = parseInt(sCount[0]);
                    var rtnCount = parseInt(sCount[1]);
                    var appCount = parseInt(sCount[2]);
                    
                    if (birCount == 0) { document.getElementById("tab1").innerHTML = "生日提醒"; }
                    if (birCount > 0 && birCount < 10) { document.getElementById("tab1").innerHTML = "生日提醒<img src='/App_Themes/ManagerTheme/Images/" + birCount + ".gif' />"; }
                    if (birCount >= 10) { document.getElementById("tab1").innerHTML = "生日提醒<img src='/App_Themes/ManagerTheme/Images/0.gif' />"; }
                    
                    if (rtnCount == 0) { document.getElementById("tab2").innerHTML = "回访提醒"; }
                    if (rtnCount > 0 && birCount < 10) { document.getElementById("tab2").innerHTML = "回访提醒<img src='/App_Themes/ManagerTheme/Images/" + rtnCount + ".gif' />"; }
                    if (rtnCount >= 10) { document.getElementById("tab2").innerHTML = "回访提醒<img src='/App_Themes/ManagerTheme/Images/0.gif' />"; }
                    
                    if (appCount == 0) { document.getElementById("tab3").innerHTML = "预约提醒"; }
                    if (appCount > 0 && appCount < 10) { document.getElementById("tab3").innerHTML = "预约提醒<img src='/App_Themes/ManagerTheme/Images/" + appCount + ".gif' />"; }
                    if (appCount >= 10) { document.getElementById("tab3").innerHTML = "预约提醒<img src='/App_Themes/ManagerTheme/Images/0.gif' />"; }
                    
                    PutDiv.innerHTML = strState[1];
                } else {
                    PutDiv.innerHTML = "<div class='mytbContent' style='text-align:center;'>服务器繁忙，请稍后再试！</div>";
                }
            }
        };
    }
}