function showAd(LType,LImg,LLink,RType,RImg,RLink)
{
    var RLeft=document.body.clientWidth-100-6;//右边广告的Left
    var LImgHtml="";
    var RImgHtml="";
    if(LType=="swf")
    {
        LImgHtml= LImgHtml+"<button onclick=\"window.open('"+LLink+"');\" style=\"border:0px;width:100px;height:300px;background:background-color\" >";
        LImgHtml= LImgHtml+"<EMBED src='docimages/ysimages/"+LImg+"' quality=high  WIDTH=100px HEIGHT=300px TYPE='application/x-shockwave-flash' id=ad_L wmode=transparent></EMBED>";
        LImgHtml= LImgHtml+"</button>";
    }
    else
    {
        LImgHtml="<img src='docimages/ysimages/"+LImg+"' width='100px' height='300px' border='0'>";
    }
    if(RType=="swf")
    {
        RImgHtml= RImgHtml+"<button onclick=\"window.open('"+RLink+"');\" style=\"border:0px;width:100px;height:300px;background:background-color\" >";
        RImgHtml= RImgHtml+"<EMBED src='docimages/ysimages/"+RImg+"' quality=high  WIDTH=100px HEIGHT=300px TYPE='application/x-shockwave-flash' id=ad_R wmode=transparent></EMBED>";
        RImgHtml= RImgHtml+"</button>";
    }
    else
    {
        RImgHtml="<img src='docimages/ysimages/"+RImg+"' width='100px' height='300px' border='0'>";
    }
    if(screen.width>1024) {//大于800分辨率显示:广告尺寸:100*300
        suspendcode="<DIV id=lovexin1 style='Z-INDEX: 10px; LEFT: 6px; POSITION: absolute; TOP: 105px; width: 100px; height: 300px;'><img src='images/close.gif' onClick='javascript:window.hide()' width='100px' height='14px' border='0px' vspace='3px' alt='关闭对联广告'><a href='"+LLink+"' target='_blank'>"+LImgHtml+"</a></DIV>"
        document.write(suspendcode);

        suspendcode="<DIV id=lovexin2 style='Z-INDEX: 10px; LEFT: "+RLeft+"px; POSITION: absolute; TOP: 105px; width: 100; height: 300px;'><img src='images/close.gif' onClick='javascript:window.hide()' width='100px' height='14px' border='0px' vspace='3px' alt='关闭对联广告'><a href='"+RLink+"' target='_blank'>"+RImgHtml+"</a></DIV>"
        document.write(suspendcode);

        //flash格式调用方法
        //<EMBED src='flash.swf' quality=high  WIDTH=100 HEIGHT=300 TYPE='application/x-shockwave-flash' id=ad wmode=opaque></EMBED>

        window.setInterval("heartBeat()",1);
    }
}

var lastScrollY=0;
var diffY=0;
var percent=0;
function heartBeat(){
    diffY=document.body.scrollTop;
    percent=0.3*(diffY-lastScrollY);
    if(percent>0)
    {
        percent=Math.ceil(percent);
    }
    else 
    {   
        percent=Math.floor(percent);
    }    
    document.all.lovexin1.style.pixelTop+=percent;
    document.all.lovexin2.style.pixelTop+=percent;
    lastScrollY=lastScrollY+percent;
}
function hide()  
{   
    lovexin1.style.visibility="hidden"; 
    lovexin2.style.visibility="hidden";
}