﻿(function() {
    var d = document,
    isStrict = d.compatMode == "CSS1Compat",
    dd = d.documentElement,
    db = d.body,
    m = Math.max,
    ie = !!d.all,
    ua = navigator.userAgent.toLowerCase(),
    head = d.getElementsByTagName('head')[0],
    getWH = function() {
        return {
            h: (isStrict ? dd: db).clientHeight,
            w: (isStrict ? dd: db).clientWidth
        }
    },
    getS = function() {
        return {
            t: m(dd.scrollTop, db.scrollTop),
            l: m(dd.scrollLeft, db.scrollLeft)
        }
    },
    getP = function(a) {
        var r = {
            t: 0,
            l: 0
        },
        isGecko = /gecko/.test(ua),
        add = function(t, l) {
            r.l += l,
            r.t += t
        },
        p = a,
        sTL = getS();
        if (a && a != db) {
            if (a.getBoundingClientRect) {
                var b = a.getBoundingClientRect();
                add(b.top + sTL.t - dd.clientTop, b.left + sTL.l - dd.clientLeft)
            } else {
                var c = d.defaultView;
                while (p) {
                    add(p.offsetTop, p.offsetLeft);
                    var e = c.getComputedStyle(p, null);
                    if (isGecko) {
                        var f = parseInt(e.getPropertyValue('border-left-width'), 10) || 0,
                        bt = parseInt(e.getPropertyValue('border-top-width'), 10) || 0;
                        add(bt, f);
                        if (p != a && e.getPropertyValue('overflow') != 'visible') add(bt, f)
                    }
                    p = p.offsetParent
                }
                p = a.parentNode;
                while (p && p != db) {
                    add( - p.scrollTop, -p.scrollLeft);
                    p = p.parentNode
                }
            }
        }
        return r
    },
    creElm = function(o, t, a) {
        var b = d.createElement(t || 'div');
        for (var p in o) {
            p == 'style' ? b[p].cssText = o[p] : b[p] = o[p]
        }
        return (a || db).insertBefore(b, (a || db).firstChild)
    },
    div = creElm({
        id: 'ckepop',
        style: "position:absolute;z-index:100000;display:none"
    }),
    div1 = creElm({
        id: 'ckepop',
        style: "position:absolute;z-index:100000;display:none;top:50%;left:50%;"
    }),
    timer,
    inputTimer,
    list,
    clist,
    as,
    texts = {},
    tagImgs = ["wofav.gif", "wofav1.gif", "wofav2.gif", "wofav3.gif", "wofav4.gif", "wofav5.gif", "wofav6.gif"],
    scripts = d.getElementsByTagName('script');
    for (var i = 0,
    ci, Bn; ci = scripts[i++];) {
        if (Bn = ci.src.match(/Bn=(\d)$/)) {
            break
        }
    };
    creElm({
        href: 'http://www.95dz.net/code/css/wofav.css',
        rel: 'stylesheet',
        type: 'text/css'
    },
    'link');
    d.write('<a href="#" onmouseover="return $CKE.over(this)" onmouseout="return $CKE.out()" onmousemove="$CKE.move()" onclick="return $CKE.center()"><img src="http://www.95dz.net/code/images/' + tagImgs[(Bn && Bn[1]) || 0] + '" width="125" height="21" border="0" id="wofav_a"/></a>');
    $CKE = {
        pop: div,
        centerpop: div1,
        disappear: function(b) {
            var c = window.event || b,
            t = c.srcElement || c.target,
            contain = div1.contains ? div1.contains(t) : !!(div1.compareDocumentPosition(t) & 16),
            a = d.getElementById('wofav_a'),
            contain1 = div.contains ? div.contains(t) : !!(div.compareDocumentPosition(t) & 16);
            if (!contain && !contain1 && t != a) {
                div1.style.display = 'none'
            }
        },
        over: function(a) {
            if (!this.a) {
                this.a = a;
                creElm({
                    src: 'http://www.95dz.net/code/ckepop.js',
                    charset: 'utf-8'
                },
                'script', head)
            } else {
                var p = getP(this.a),
                wh = getWH(),
                tl = getS();
                with(div.style) {
                    display = "block";
                    top = (p.t + this.a.offsetHeight + div.offsetHeight > wh.h + tl.t ? p.t - div.offsetHeight - (ie ? 1 : 8) : p.t + this.a.offsetHeight + 1) + 'px';
                    left = p.l + 'px'
                }
            };
            return false
        },
        out: function() {
            timer = setTimeout(function() {
                div.style.display = 'none'
            },
            100)
        },
        move: function() {
            clearTimeout(timer)
        },
        center: function() {
            div.style.display = 'none';
            if (!this.script) {
                this.script = creElm({
                    src: 'http://www.95dz.net/code/ckecenterpop.js',
                    charset: 'utf-8'
                },
                'script', head);
                db.style.position = 'static'
            } else {
                var a = getS();
                div1.style.display = "block";
                div1.style.margin = ( - div1.offsetHeight / 2 + a.t) + "px " + ( - div1.offsetWidth / 2 + a.l) + "px";
                list = d.getElementById('ckelist'),
                clist = list.cloneNode(true),
                as = clist.getElementsByTagName('input');
                for (var i = 0,
                ci; ci = as[i++];) {
                    texts[ci.value] = ci.parentNode
                }
            }
            return false
        },
        choose: function(o) {
            clearTimeout(inputTimer);
            inputTimer = setTimeout(function() {
                var s = o.value.replace(/^\s+|\s+$/, ''),
                frag = d.createDocumentFragment();
                for (var p in texts) {
                    eval("var f = /" + (s || '.') + "/ig.test(p)");
                    f && frag.appendChild(texts[p].cloneNode(true))
                }
                list.innerHTML = '';
                list.appendChild(frag)
            },
            100)
        },
        centerClose: function() {
            div1.style.display = 'none'
        }
    };
    div.onmouseover = function() {
        clearTimeout(timer)
    };
    div.onmouseout = function() {
        $CKE.out()
    };
    ie ? d.attachEvent("onclick", $CKE.disappear) : d.addEventListener("click", $CKE.disappear, false)
})();
function wofav_sendto(m) {
    window.open('http://www.95dz.net/send.php?webid=' + m + '&url=' + encodeURIComponent(location) + '&title=' + encodeURIComponent(document.title), '');
    return false
};
function jt_copyUrl() {
    var a = this.location.href;
    var b = document.title;
    if (window.clipboardData) {
        var c = b + "\n" + a;
        var d = window.clipboardData.setData("Text", c);
        if (d) alert("复制成功,请粘贴到你的QQ/MSN上推荐给你的好友！")
    } else {
        alert("目前只支持IE，请复制地址栏URL,推荐给你的QQ/MSN好友！")
    }
};
function jt_addBookmark(a) {
    var b = parent.location.href;
    if (window.sidebar) {
        window.sidebar.addPanel(a, b, "")
    } else if (document.all) {
        window.external.AddFavorite(b, a)
    } else if (window.opera && window.print) {
        return true
    }
}
document.writeln("<script type=\"text\/javascript\">");
document.writeln("var _bdhmProtocol = ((\"https:\" == document.location.protocol) ? \" https:\/\/\" : \" http:\/\/\");");
document.writeln("document.write(unescape(\"%3Cscript src=\'\" + _bdhmProtocol + \"hm.baidu.com\/h.js%3F5e019fb478e88bdac70778619dbda718\' type=\'text\/javascript\'%3E%3C\/script%3E\"));");
document.writeln("<\/script>")
