﻿//<a href='http://www.minibuy.com/promotion/healthy-dj.html' target='_blank'><img src=http://www.minibuy.com/Promotion/images/0001.jpg border='0'></a>

lastScrollYs=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-lastScrollYs); 
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";

var tmp = parseInt(document.getElementById("lovexin13").style.top)+percent;

//document.body.offsetHeight

//document.getElementById("lovexin13").style.top=parseInt(document.getElementById("lovexin13").style.top)+percent+"px";

lastScrollYs=lastScrollYs+percent; 
//alert(lastScrollYs);
}
//suspendcode12="<DIV id=\"lovexin12\" style='left:15px;POSITION:absolute;TOP:50px; width:120px;background-color:#FCEDC1;'><a href=JavaScript:; onclick=\"hidead()\" style='float:right;'><img border=0 src=http://ad.jz123.cn/ad/33/inc/close.gif></a><br><a href='http://www.minibuy.com/Activity/Index.aspx' target='_blank'><img src=http://www.minibuy.com/Promotion/images/人气家庭pp.jpg border='0'></a></div>"
suspendcode13="<DIV id=\"lovexin13\" style='left:15px;POSITION:absolute;TOP:300px; width:120px;background-color:#FFFFFF;'><a href='http://www.minibuy.com/Live/Default.aspx' target='_blank'><img src=http://www.minibuy.com/images/piao01.jpg border='0'></a></div>"


//document.write(suspendcode12); 
//document.write(suspendcode13); 
//window.setInterval("heartBeat()",30);
function hidead()
{
 document.getElementById("lovexin12").style.display="none";
 document.getElementById("lovexin13").style.display="none";
}

//时间、高度
    var time = 500;
    var h = 0;
    function addCount()
    {
        if(time>0)
        {
           time--;
            h = h+5;
            
        }
        else
        {
            return;
        }
        if(h>584) //高度
        {
            return;
        }
       
        document.getElementById("ads").style.display = "block";
       
        document.getElementById("ads").style.height = h+"px";
        setTimeout("addCount()",30); 
    }
    
    function showAds()
    {
        //addCount();
        alert(1);
        document.getElementById("ads").style.display = "block";
        setTimeout("noneAds()",5000); //停留时间自己适当调整
    }
    var T = 500;
    var N = 584; //高度
    function noneAds()
    {
        if(T>0)
        {
            T--;
            N = N-5;
        }
        else
        {
            return;
        }
        if(N<0)
        {
            
            document.getElementById("ads").style.display = "none";
            return;
        }
        document.getElementById("ads").style.height = N+"px";
        setTimeout("noneAds()",30); 
    }
      