      var T = 500;
    var N = 450; //高度
  var time = 500;
    var h = 0;
    function addCount()
    {
        if(time>0)
        {
            time--;
            h = h+5;
        }
        else
        {
            return;
        }
        if(h>=N)  //高度
        {
            noneAds();
	    //setTimeout("noneAds()",5000);
            return;
        }
        document.getElementById("ads").style.display = "";
        document.getElementById("ads").style.height = h+"px";
        setTimeout("addCount()",30);
    }
 
  function showAds()
    {
        addCount();
        //setTimeout("noneAds()",5000); //停留时间自己适当调整
	//setTimeout("noneAds_goon()",15000); 
    }

    function noneAds()
    {
        if(T>0)
        {
            T--;
            N = N-5;
        }
        else
        {
            return;
        }
        if(N<=80)
        {
	setTimeout("noneAds_goon()",15000); 
       //document.getElementById("ads").style.display = "none";
 	return;
	
          
        }
 
        document.getElementById("ads").style.height = N+"px";
        setTimeout("noneAds()",30);
    }

    function noneAds_goon()
    {
        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_goon()",30);
    }




showAds();
