﻿
lastScrollY = 0;
function heartBeat() {
    var diffY;
    if (document.documentElement && document.documentElement.scrollTop)
        diffY = document.documentElement.scrollTop;
    else if (document.body)
        diffY = document.body.scrollTop
    else
    { /*Netscape stuff*/ }

    //alert(diffY);
    percent = .1 * (diffY - lastScrollY);
    if (percent > 0) percent = Math.ceil(percent);
    else percent = Math.floor(percent);
    document.getElementById("lovexin12").style.top = parseInt(document.getElementById

("lovexin12").style.top) + percent + "px";
    document.getElementById("lovexin14").style.top = parseInt(document.getElementById

("lovexin12").style.top) + percent + "px";

    lastScrollY = lastScrollY + percent;

}
suspendcode12 = "<DIV id=\"lovexin12\" style='left:2px;POSITION:absolute;TOP:120px;'></div>"
suspendcode14 = "<img id=\"lovexin14\" style=\"right:2px;POSITION:absolute;TOP:120px; border:none\" src=\"/images/righthxjqcom.gif\" alt=\"红星机械厂总站\" usemap=\"#Map3\" /><map name=\"Map3\" id=\"Map3\"><area alt=\"关闭悬浮窗口\" shape=\"rect\" coords=\"212,1,226,12\" onclick=\"closeBanner();\"/><area alt=\"跳转到红星主站\" shape=\"rect\" coords=\"1,1,211,132\" href=\"http://www.hxjq.com\" target=\"_blank\" /></map>"
document.write(suspendcode12);
document.write(suspendcode14);
window.setInterval("heartBeat()", 1);
function closeBanner() {
    document.getElementById("lovexin14").style.display = 'none';

}
