﻿//suspendcode="<DIV id=\"lovexin12\" style='left:2px;POSITION:absolute;TOP:200px;'><img src='../AD_image/close.gif' onClick='javascript:window.hide()' width='84' height='14' border='0' vspace='3' alt='关闭对联广告'><br/><a href='../Farm/Farm_CarManage.aspx/' target='_blank'><img src='../image/FarmCar.gif' width='90' height='139' border='0'></a></DIV>"
//document.write(suspendcode);

suspendcode="<DIV id=\"lovexin14\" style='right:2px;POSITION:absolute;TOP:200px;'><img src='../AD_image/close.gif' onClick='javascript:window.hide()' width='84' height='14' border='0' vspace='3' alt='购物车'><br/><a href='../Farm/Farm_CarManage.aspx' target='_blank'><img src='../image/FarmCar.gif' width='90' height='139' border='0'></a></DIV>"
document.write(suspendcode);

window.setInterval("heartBeat()",1);
//flash格式调用方法
//<EMBED src='flash.swf' quality=high  WIDTH=100 HEIGHT=300 TYPE='application/x-shockwave-flash' id=ad wmode=opaque></EMBED>

function hide()  
{   
    //lovexin12.style.visibility="hidden"; 
    lovexin14.style.visibility="hidden";
}

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("lovexin14").style.top)+percent+"px";

    lastScrollY=lastScrollY+percent; 
    //alert(lastScrollY);
}
