
function changeindex(x, tid) {
    var obj;
    var tTd;
    var i = 0;
    for (i = 1 + (x - 1) * 28; i <= x * 28; i++) {
        obj = document.getElementById("div" + i);
        tTd = document.getElementById("t" + i);
        if (parseInt(tid) + (x - 1) * 28 == i) {
            obj.style.display = "block";
        }
        else {
            obj.style.display = "none";
        }
    }
}
//除了首页，其他页面就用这个方法
function change(x, tid) {
    var obj;
    var tTd;
    var i = 0;

    for (i = 1 + (x - 1) * 28; i <= x * 28; i++) {
        obj = document.getElementById("div" + i);
        tTd = document.getElementById("t" + i);
        if (parseInt(tid) + (x - 1) * 28 == i) {
            obj.style.display = "block";
        }
        else {
            obj.style.display = "none";
        }
    }
}

function getPosition() {
    var top = document.documentElement.scrollTop + 280;
    var left = document.documentElement.scrollLeft + 460;
    var height = document.documentElement.clientHeight;
    var width = document.documentElement.clientWidth;
    return { top: top, left: left, height: height, width: width };
}

function showPop() {
    var width = 68; //弹出框的宽度 
    var height = 93; //弹出框的高度 
    var obj = document.getElementById("pop");

    obj.style.display = "block";
    obj.style.position = "absolute";
    obj.style.zindex = "999";
    obj.style.width = width + "px";
    obj.style.height = height + "px";

    var Position = getPosition();
    leftadd = (Position.width - width) / 2;
    topadd = (Position.height - height) / 2;
    obj.style.top = (Position.top + topadd) + "px";
    obj.style.left = (Position.left + leftadd) + "px";

    window.onscroll = function() {
        var Position = getPosition();
        obj.style.top = (Position.top + topadd) + "px";
        obj.style.left = (Position.left + leftadd) + "px";
    };
}

function hidePop() {
    document.getElementById("pop").style.display = "none";
}

function getIE(e, type) {
    var t = e.offsetTop;
    var l = e.offsetLeft;
    while (e = e.offsetParent) {
        t += e.offsetTop;
        l += e.offsetLeft;
    }
    if (type == 1) {
        return t;
    } else {
        return l;
    }
}
   
