// JScript ļ

var ua = navigator.userAgent;
var $IE = (navigator.appName == "Microsoft Internet Explorer");
var $IE5 = $IE && (ua.indexOf("MSIE 5") != -1);
var $IE5_0 = $IE && (ua.indexOf("MSIE 5.0") != -1);
var $Gecko = ua.indexOf("Gecko") != -1;
var $Safari = ua.indexOf("Safari") != -1;
var $Opera = ua.indexOf("Opera") != -1;
var $Mac = ua.indexOf("Mac") != -1;
var $NS7 = ua.indexOf("Netscape/7") != -1;
var $NS71 = ua.indexOf("Netscape/7.1") != -1;

if ($Opera) {
    $IE = true;
    $Gecko = false;
    $Safari = false
}
if ($IE5) {
    $IE = true;
    $Gecko = false;
    $Safari = false
}



function $_t(B, A, E) {
    var C = B.getElementsByTagName(A);
    for (var D = 0; D < C.length; D++) {
        if (C[D].id == E) {
            return C[D]
        }
    }
    return null
}



function _(A) {
    var F = arguments;
    var G = 0;
    if (typeof(A) == "string") {
        A = document
    } else {
        G = 1
    }

    for (var D = G; D < F.length; D++) {
        var E = A.getElementsByTagName("*");
        var C = false;
        for (var B = 0; B < E.length; B++) {
            if (E[B].id == F[D]) {
                A = E[B];
                C = true;
                break
            }
        }
        if (!C) {
            return null
        }
    }
    return A
}



function $dele(o, fn, rv) {
    var r = function () {
        var s = arguments.callee;
        var args = [];
        for (var i = 0; i < s.length; i++) {
            args[i] = s[i]
        }
        var argStr = args.join(",");
        if (argStr.length > 0) {
            argStr = "," + argStr
        }
        var callStr = "s.thiz[s.fn](" + argStr + ")";
        var v = eval(callStr);
        if (s.rv != null) {
            return s.rv
        } else {
            return v
        }
    };
    r.thiz = o;
    r.fn = fn;
    r.rv = rv;
    return r
}



function $ge(A) {
    if (A != null) {
        return A
    }
    if ($IE) {
        return window.event
    } else {
        return A
    }
}



function $gte(B, A) {
    if (!B.getElementById) {
        B = B.ownerDocument
    }
    if ($IE) {
        return A != null ? A : B.parentWindow.event
    } else {
        return A;
        throw new Error("this method can only execute in IE")
    }
}



function $addEL(F, E, D, C) {
    if ($IE) {
        if (F["$__listener_" + E] == null) {
            var B = function (J) {
                var I = arguments.callee;
                var G = I.fList;
                J = $ge(J);
                for (var H = 0; H < G.length; H++) {
                    G[H](J)
                }
            };
            B.fList = [];
            F["$__listener_" + E] = B;
            F["on" + E] = F["$__listener_" + E]
        }
        var A = F["$__listener_" + E].fList;
        A[A.length] = D
    } else {
        F.addEventListener(E, D, C)
    }
}

function $cancelEvent(A) {
    if ($IE) {
        A.returnValue = false;
        A.cancelBubble = true
    } else {
        A.preventDefault()
    }
}

function $cpAttr(D, C) {
    for (var A in C) {
        var B = C[A];
        D[A] = B
    }
    return D
}

function $getValue(A, B) {
    return A == null ? B : A
}
var $gv = $getValue;
var $dom = {
    parseInt: function (A) {
        if (A == null || A == "" || typeof(A) == "undefined") {
            return 0
        }
        return parseInt(A)
    },
    getClientSize: function (G) {
        if ($IE) {
            var D = {
                x: G.clientLeft,
                y: G.clientTop
            };
            D.l = D.x;
            D.t = D.y;
            D.r = G.clientRight;
            D.b = G.clientBottom;
            D.w = G.clientWidth;
            D.h = G.clientHeight;
            return D
        } else {
            var C = G.style;
            if (C.borderLeftWidth.length == 0 || C.borderTopWidth.length == 0 || C.borderRightWidth.length == 0 || C.borderBottomWidth.length == 0) {
                var B = G.offsetWidth;
                C.borderLeftWidth = "0px";
                B -= G.offsetWidth;
                var E = G.offsetWidth;
                C.borderRightWidth = "0px";
                E -= G.offsetWidth;
                var F = G.offsetHeight;
                C.borderTopWidth = "0px";
                F -= G.offsetHeight;
                var A = G.offsetHeight;
                C.borderBottomWidth = "0px";
                A -= G.offsetHeight;
                C.borderLeftWidth = B + "px";
                C.borderTopWidth = F + "px";
                C.borderRightWidth = E + "px";
                C.borderBottomWidth = A + "px";
                var D = {
                    l: B,
                    r: E,
                    t: F,
                    b: A,
                    x: B,
                    y: F
                };
                return D
            } else {
                var D = {
                    x: this.parseInt(G.style.borderLeftWidth),
                    y: this.parseInt(G.style.borderTopWidth),
                    r: this.parseInt(G.style.borderRightWidth),
                    b: this.parseInt(G.style.borderBottomWidth)
                };
                D.l = D.x;
                D.t = D.y;
                return D
            }
        }
    },
    getSize: function (D, B) {
        var C = {
            x: D.offsetWidth != null ? D.offsetWidth : 0,
            y: D.offsetHeight != null ? D.offsetHeight : 0
        };
        if (B) {
            var A = this.getMargin(D);
            C.x += A.l + A.r;
            C.y += A.t + A.b
        }
        return C
    },
    setSize: function (E, B, H, F) {
        if ($IE) {
            if (F) {
                var A = this.getMargin(E);
                B -= A.l + A.r;
                H -= A.t + A.b
            }
            E.style.width = B;
            E.style.height = H
        } else {
            var G = this.getClientSize(E);
            var D = G.l + G.r;
            var C = G.t + G.b;
            E.style.width = B - D + "px";
            E.style.height = H - C + "px"
        }
    },
    getPosition: function (B, C) {
        var D;
        D = {
            x: B.offsetLeft,
            y: B.offsetTop
        };
        if (C) {
            var A = this.getMargin(B);
            D.x -= A.l;
            D.y -= A.t
        }
        return D
    },
    setPosition: function (B, A, D, C) {
        if (C) {}
        B.style.left = A + "px";
        B.style.top = D + "px"
    },
    setAlpha: function (B, A) {
        return;
        B.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + A * 100 + ");";
        B.style.opacity = A;
        B.style.MozOpacity = A
    }
};
var $motion = {
    smooth: function (B, C, A) {
        if (A > 1) {
            A = 1
        }
        return (C - B) * A + B
    }
};

function PopUp(D, A) {
    this.id = D;
    var C = this.config = A;
    C.width = $gv(C.width, 300);
    C.height = $gv(C.height, 200);
    C.bottom = $gv(C.bottom, 0);
    C.right = $gv(C.right, 20);
    C.display = $gv(C.display, true);
    C.contentUrl = $gv(C.contentUrl, "");
    C.motionFunc = $gv(C.motionFunc, $motion.smooth);
    C.position = {
        x: 0,
        y: 0
    };
    var B = C.time;
    B.slideIn = $gv(B.slideIn, 10);
    B.hold = $gv(B.hold, 10);
    B.slideOut = $gv(B.slideOut, 10);
    B.slideIn *= 1000;
    B.hold *= 1000;
    B.slideOut *= 1000;
    this.container = document.body;
    this.popup = null;
    this.content = null;
    this.switchButton = null;
    this.moveTargetPosition = 0;
    this.startMoveTime = null;
    this.startPosition = null;
    this.status = PopUp.STOP;
    this.intervalHandle = null;
    this.mm = "max";
    this.imgMin = "http://www.1netmedia.net/temp/popuDialog/images/min.gif";
    this.imgMax = "http://www.1netmedia.net/temp/popuDialog/images/max.gif"
}
PopUp.STOP = 0;
PopUp.MOVE_DOWN = 1;
PopUp.MOVE_UP = 2;
PopUp.SWITCH_TO_MIN = PopUp.MOVE_DOWN | 4;
PopUp.SWITCH_TO_MAX = PopUp.MOVE_UP | 8;
var __o = {
    create: function () {
        var E = document;
        var F = this.config;
        var D = this.popup = E.createElement("div");
        this.container.appendChild(D);
        D.id = this.id;
        D.style.cssText = "position:absolute;						z-index:9000;						overflow:hidden;						border:0px solid #f00;						";
        $dom.setSize(D, F.width, F.height);
        var C = this.content = E.createElement("div");
        D.appendChild(C);
        C.id = this.id + "_content";
        C.style.cssText = "position:absolute;						z-index:1;						overflow:hidden;";
        $dom.setSize(C, F.width, F.height);
        $dom.setPosition(C, 0, 0);
        F.position.y = F.height;
        this.onresize();
        C.innerHTML = "<a id='closeButton' href='#'></a><iframe id='" + this.id + "_content_iframe' src=" + F.contentUrl + " frameborder=0 scrolling=no width='100%' height='100%'></iframe>";
        var B = $_t(C, "a", "closeButton");
        B.style.cssText = 'position:absolute;							z-index:2;														font-size:0px;line-height:0px;left:247px;top:9px;width:15px;height:15px;background-image:url("");';
        $addEL(B, "mouseover", function (G) {
            $dom.setAlpha(this, 0.4)
        },
        true);
        $addEL(B, "mouseout", function (G) {
            $dom.setAlpha(this, 1)
        },
        true);
        $addEL(B, "click", $dele(this, "hide"), true);
        $addEL(B, "click", $cancelEvent, true);
        var A = (document.documentElement && document.documentElement.clientWidth) ? document.documentElement : document.body;
        $addEL(document.body, "resize", $dele(this, "onresize"), true);
        this.__hackTimer = window.setInterval("__popup.onresize()", 50);
        $addEL(A, "scroll", $dele(this, "onresize"), true);
        this.onresize()
    },
    show: function () {
        if (!this.config.display) {
            return
        }
        this.moveTargetPosition = 0;
        this.status = PopUp.MOVE_UP;
        this.startMove()
    },
    hide: function () {
        this.moveTargetPosition = this.config.height;
        this.status = PopUp.MOVE_DOWN;
        this.startMove()
    },
    minimize: function () {
        this.mm = "min";
        this.moveTargetPosition = this.config.height - 25;
        this.status = PopUp.SWITCH_TO_MIN;
        this.startMove();
        var B = this.switchButton.style;
        var A = B.backgroundImage;
        if (A.indexOf(this.imgMin) > -1) {
            A = A.replace(this.imgMin, this.imgMax);
            B.backgroundImage = A
        }
    },
    maximize: function () {
        if (!this.config.display) {
            return
        }
        this.mm = "max";
        this.moveTargetPosition = 0;
        this.status = PopUp.SWITCH_TO_MAX;
        this.startMove();
        var B = this.switchButton.style;
        var A = B.backgroundImage;
        if (A.indexOf(this.imgMax) > -1) {
            A = A.replace(this.imgMax, this.imgMin);
            B.backgroundImage = A
        }
    },
    delayHide: function () {
        window.setTimeout("__popup.hide()", this.config.time.hold)
    },
    delayMin: function () {
        window.setTimeout("__popup.minimize()", this.config.time.hold)
    },
    switchMode: function () {
        if (this.mm == "min") {
            this.maximize()
        } else {
            this.minimize()
        }
    },
    startMove: function () {
        this.stopMove();
        this.intervalHandle = window.setInterval("__popup.move()", 100);
        this.startMoveTime = new Date().getTime();
        this.startPosition = this.config.position.y
    },
    stopMove: function () {
        if (this.intervalHandle != null) {
            window.clearInterval(this.intervalHandle)
        }
        this.intervalHandle = null
    },
    move: function () {
        var A = new Date().getTime();
        A = A - this.startMoveTime;
        var B = this.status & PopUp.MOVE_UP ? this.config.time.slideIn : this.config.time.slideOut;
        var C = this.config.motionFunc(this.startPosition, this.moveTargetPosition, A / B);
        this.config.position.y = C;
        this.onresize();
        if (A >= B) {
            this.onFinishMove()
        }
    },
    onFinishMove: function () {
        this.stopMove();
        if (this.status == PopUp.MOVE_UP && this.config.time.hold > 0) {
            this.delayMin()
        } else {
            if (this.__hackTimer != null) {
                window.clearInterval(this.__hackTimer)
            }
        }
        this.status = PopUp.STOP
    },
    onresize: function () {
        var F = this.config;
        var D = (document.documentElement && document.documentElement.clientWidth) ? document.documentElement : document.body;
        var C = D.clientWidth + D.scrollLeft;
        var B = D.clientHeight + D.scrollTop;
        var A = C - F.right - F.width;
        var E = B - F.bottom - F.height + F.position.y;
        $dom.setPosition(this.popup, A, E);
        $dom.setSize(this.popup, F.width, F.height - F.position.y)
    }
};
$cpAttr(PopUp.prototype, __o);

function readCookie(A) {
    var C = "";
    var B = A + "=";
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(B);
        if (offset != -1) {
            offset += B.length;
            end = document.cookie.indexOf(";", offset);
            if (end == -1) {
                end = document.cookie.length
            }
            C = unescape(document.cookie.substring(offset, end))
        }
    }
    return C
}

function writeCookie(C, D, A) {
    var B = "";
    if (A != null) {
        B = new Date((new Date()).getTime() + A * 3600000);
        B = "; expires=" + B.toGMTString()
    }
    document.cookie = C + "=" + escape(D) + B + ";path=/"
}

function job() {
    var D = {
        width: 277,
        height: 313,
        bottom: 2,
        right: 1,
        display: true,
        contentUrl: "http://blog.jrj.com.cn/spPreview/lowerRightCorner.html",
        time: {
            slideIn: 1,
            hold: 86400,
            slideOut: 1
        }
    };
    var C = ["7+7"];
    var R = "eachTime";
    var T = "1NetMedia.NET_popup_next_display_time";
    var Q = {};
    var A = [];
    for (var O = 0; O < C.length; O++) {
        var I = C[O];
        var H = I.split("+");
        var E = parseInt(H[0]);
        for (var K = 0; K < H.length - 1; K++) {
            H[K] = H[K + 1]
        }
        Q[E] = true;
        for (var M = 0; M < H.length; M++) {
            Q[E + parseInt(H[M])] = true
        }
    }
    C = [];
    for (var O in Q) {
        var F = parseInt(O);
        if (isNaN(F)) {
            continue
        }
        C[C.length] = F
    }
    C = C.sort();
    var N = new PopUp("xp", D);
    window.__popup = N;
    N.create();
    var J = readCookie(T);
    if (R == "eachTime") {
        N.show()
    } else {
        var B = new Date().getTime();
        if (J == null || B > J) {
            N.show();
            var V = new Date().getHours();
            var U = 60 * 60 * 1000;
            var L = C.concat(),
                P = L.length;
            for (var O = 0; O < P; O++) {
                L[P + O] = L[O] + 24
            }
            for (var O = 0; O < L.length && V >= L[O]; O++) {}
            var G = new Date();
            G.setHours(L[O] > 23 ? L[O] - 24 : L[O]);
            var S = G.getTime();
            if (L[O] > 23) {
                S += U * 24
            }
            writeCookie(T, S, 24)
        }
    }
}

function doit() {
    if (document.body == null) {
        window.setTimeout(doit, 500);
        return
    }
    job()
}

function pop(request) {
    var str = request.responseText.replace(/^\s+|\s+$/g, "");
    var flag = eval("(" + str + ")");
    if (flag == true) {
        doit()
    } else {
        if (flag == false) {
            return false
        }
    }
};
