document.write('<div id="live_img" style="POSITION: absolute; "><div id="floatChat" style="Z-INDEX: 1; LEFT: 930px; WIDTH: 25px; POSITION: absolute; TOP: 12px; HEIGHT: 120px;"><a href="tencent://message/?uin=897626355&Site=在线QQ&Menu=yes"> <img border="0" src="http://wpa.qq.com/pa?p=2:897626355:20" alt="点击这里给我发消息"></a> </div></div>');

lastScrollYChat = 0;
function floatDiv() {
    var diffY;
    if (document.documentElement && document.documentElement.scrollTop)
        diffY = document.documentElement.scrollTop;
    else if (document.body)
        diffY = document.body.scrollTop
    else { /*Netscape stuff*/ }

    percent = .1 * (diffY - lastScrollYChat);
    if (percent > 0) percent = Math.ceil(percent);
    else percent = Math.floor(percent);
    document.getElementById("floatChat").style.top = parseInt(document.getElementById("floatChat").style.top) + percent + "px";
    lastScrollYChat = lastScrollYChat + percent;
}
setTimeout(function() { window.setInterval("floatDiv()", 1); }, 1500);


if (window.hichina == undefined)
    window.hichina = {};

if (window.hichina.live800 == undefined)
    window.hichina.live800 = {};


// 第三方动画类库 jelle.animate
var jelle = function(h) { var a = document.getElementById(h), o = 0, e = {}, l = 10, k = function(b, c, g, d) { return -g * (b /= d) * (b - 2) + c }, n = function(b, c) { var g, d = /^([^\d]+)([\d.]+)/; if (d.test(b)) { d = b.match(d); d[2] = parseFloat(d[2]); switch (d[1]) { case "+=": g = d[2]; break; case "-=": g = -d[2]; break; case "*=": g = c * d[2] - c; break; case "/=": g = c / d[2] - c; break } return g } return parseFloat(b) - c }; a.animate = a.animate || []; jelle[h] = {}; jelle[h].stop = true; e.entrance = function(b, c, g) { setTimeout(function() { b(c[0], c[1], c[2]) }, g || 0) }; e.stop = function() { jelle[h].stop = false; delete a.animate; document.getElementById(h).animate && delete document.getElementById(h).animate; return e }; e.queue = function() { if (a.animate && ++o == a.animate[0].length) { o = 0; a.animate[0].callback && a.animate[0].callback.apply(a); if (a.animate.length > 1) { a.animate[0].callback = a.animate[1].callback; a.animate = document.getElementById(h).animate || []; a.animate.shift(); document.getElementById(h).animate = a.animate; for (var b = a.animate[0], c = 0; c < b.length; c++) b[c][0] === "opacity" ? e.entrance(e.alpha, [b[c][1], b[c][2]], l) : e.entrance(e.execution, [b[c][0], b[c][1], b[c][2]], l) } else { a.animate.length = 0; document.getElementById(h).animate.length = 0 } } }; e.lazy = function(b) { l = b; return e }; e.execution = function(b, c, g) { var d = (new Date).getTime(), f = g || 500, j = parseFloat(a.style[b]) || 0, i = n(c, j), p = c.match(/\d+(.+)/)[1]; (function() { var m = (new Date).getTime() - d; if (m > f) { m = f; a.style[b] = parseInt(k(m, j, i, f)) + p; e.queue(); return e } a.style[b] = parseInt(k(m, j, i, f)) + p; jelle[h].stop && setTimeout(arguments.callee, 10) })() }; e.animate = function(b, c, g) { var d = a.animate.length; a.animate[d] = []; a.animate[d].callback = g; for (var f in b) { a.animate[d].push([f, b[f], c]); if (d == 0) f == "opacity" ? e.entrance(e.alpha, [b[f], c], l) : e.entrance(e.execution, [f, b[f], c], l) } document.getElementById(h).animate = a.animate; return e }; e.alpha = function(b, c) { var g = (new Date).getTime(), d = c || 500, f, j; if (document.defaultView) { f = document.defaultView.getComputedStyle(a, null).opacity || 1; j = n(b, f) * 100; (function() { var i = (new Date).getTime() - g; if (i > d) { i = d; a.style.opacity = k(i, 100 * f, j, d) / 100; e.queue(); return e } a.style.opacity = k(i, 100 * f, j, d) / 100; jelle[h].stop && setTimeout(arguments.callee, 10) })() } else { f = a.currentStyle.filter ? a.currentStyle.filter.match(/^alpha\(opacity=([\d\.]+)\)$/)[1] / 100 : 1; j = n(b, f) * 100; (function() { var i = (new Date).getTime() - g; if (i > d) { i = d; a.style.filter = "alpha(opacity=" + k(i, 100 * f, j, d) + ")"; e.queue(); return e } a.style.filter = "alpha(opacity=" + k(i, 100 * f, j, d) + ")"; jelle[h].stop && setTimeout(arguments.callee, 10) })() } }; return e };


var xoffsetTop = 0, xoffsetLeft = 0;
/// 获取对象位置 无限递归，使用前先置 0 xoffsetTop xoffsetLeft
function getTopPix(obj) {
    xoffsetTop += obj.offsetTop;
    xoffsetLeft += obj.offsetLeft;
    if (obj.offsetParent) {
        getTopPix(obj.offsetParent);
    }
}

//hichina.live800.ShowLive800Box 显示box
window.hichina.live800.ShowLive800Box = function() {
    var hichina_live800Box_check = hichina.live800.getCookie("hichinalive800Boxcheck");
    if (hichina_live800Box_check && hichina_live800Box_check == "1") {
        return;
    }
    var myWidth = 0, myHeight = 0;
    if (typeof (window.innerWidth) == "number") {
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } else {
        if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
            myWidth = document.documentElement.clientWidth;
            myHeight = document.documentElement.clientHeight;
        } else {
            if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
                myWidth = document.body.clientWidth;
                myHeight = document.body.clientHeight;
            }
        }
    }
    var left = (myWidth - 302) / 2;
    var top = (myHeight - 198) / 2 + document.documentElement.scrollTop;

    xoffsetTop = 0;
    xoffsetLeft = 0;
    var floatChat = document.getElementById("floatChat");
    getTopPix(floatChat);


    var hichina_live800Box = document.createElement("div");
    hichina_live800Box.innerHTML = boxHtml;
    document.body.appendChild(hichina_live800Box);
    jelle('hichina_live800Box').animate({ width: '310px', height: '206px', top: top + "px", left: left + "px", 'opacity': 1 }, 1000, function() { });
}

// hichina.live800.setCookie
window.hichina.live800.setCookie = function(sName, sValue) {
     document.cookie = sName + "=" + escape(sValue) + "; expires=Fri, 31 Dec 2099 23:59:59 GMT; path=/";
}

// hichina.live800.getCookie
window.hichina.live800.getCookie = function(sName) {
    var aCookie = document.cookie.split("; ");
    for (var i = 0; i < aCookie.length; i++) {
        var aCrumb = aCookie[i].split("=");
        if (sName == aCrumb[0])
            return unescape(aCrumb[1]);
    }
    return null;
}

//hichina.live800.HideLive800Box 隐藏box
window.hichina.live800.HideLive800Box = function() {
    xoffsetTop = 0;
    xoffsetLeft = 0;
    var floatChat = document.getElementById("floatChat");
    getTopPix(floatChat);
    //xoffsetLeft = xoffsetLeft - 302;
    var hichina_live800Box_check = document.getElementById("hichina_live800Box_check");
    var ishichina_live800Box_check = hichina_live800Box_check.getAttribute("checked");
    if (ishichina_live800Box_check) {
        hichina.live800.setCookie("hichinalive800Boxcheck", "1");
    }
    //jelle('hichina_live800Box').stop();
    jelle('hichina_live800Box').animate({ width: '0px', height: '0px', top: xoffsetTop + "px", left: xoffsetLeft + "px", 'opacity': 0 }, 1000, function() { });
}

//定时执行
//setTimeout(function() { hichina.live800.ShowLive800Box(); }, 60000);
//hichina.live800 end ...
