var ads_time = 500; 
var ads_h = 0; 
function addCount() 
{ 
if(ads_time>0) 
{ 
ads_time--; 
ads_h = ads_h+50; 
} 
else 
{ 
return; 
} 
if(ads_h>=260) //高度 
{ 
return; 
} 
document.getElementById("ads").style.display = ""; 
document.getElementById("ads").style.height = ads_h+"px"; 
setTimeout("addCount()",30); 
} 

window.onload = function showAds() 
{ 
addCount(); 
setTimeout("noneAds()",12000); //停留时间自己适当调整 
}

var ads_T = 500; 
var ads_N = 260; //高度。如果高度调整不正确，可能会导致图片无法自动收缩 
function noneAds() 
{ 
if(ads_T>0) 
{ 
ads_T--; 
ads_N = ads_N-5; 
} 
else 
{ 
return; 
} 
if(ads_N<=0) 
{ 
document.getElementById("ads").style.display = "none"; 
return; 
} 

document.getElementById("ads").style.height = ads_N+"px"; 
setTimeout("noneAds()",30); 
} 
