var time = 500;
var h = 0;

/*window.onload = function showTopAds() {
  addCount();
  setTimeout("noneAds()", 10000); //设定首页广告停留时间
}*/

function addCount() {
  if(time > 0) {
    time--;
    h = h + 5;
  } else {
   	return;
  }
  
  if(h > 120) { //高度
    return;
  }
  
  document.getElementById("topAdvertismentBox").style.display = "";
  document.getElementById("topAdvertismentBox").style.height = h+"px";
  setTimeout("addCount()", 30); 
}


var T = 120;
var N = 120; //高度
function noneAds() {
	if(T > 0) {
	  T--;
	  N = N-5;
	} else {
	  return;
	}
	
	if(N < 0) {
	  document.getElementById("topAdvertismentBox").style.display = "none";
	  return;
	}
	
	document.getElementById("topAdvertismentBox").style.height = N+"px";
	setTimeout("noneAds()",30); 
}
