var hmax = 140-1;//最大高度
var hmin = 42;//最小高度
var h=15;
var gd=0;
var panduan=true;
function addCount(){

	if(!panduan){
		return;
		}
		
	if(h<hmax){
		h += 10;
		setTimeout("addCount()",1); 
	}	
	else {
		h=hmax;
		panduan = false;
		setTimeout("noneAds()",30000); //停留时间自己适当调整 5000 = 1秒

	
	}
	document.getElementById("adsbtn").style.display = "none";
	document.getElementById("adsbtncl").style.display = "";
	document.getElementById("ads").style.display = "";
	document.getElementById("ads").style.height = h+"px";
}
window.onload = function openAds(){
	document.getElementById("ads").style.display = "none";
	document.getElementById("ads").style.height = "0px";
	
	addCount(); //慢慢打开
//	h=hmax; 
//	setTimeout("noneAds()",3000); //停留时间自己适当调整 1000 = 1秒
}
function openAds(){
	document.getElementById("ads").style.height = "0px";
	if(!panduan){
		panduan=true;
	}
	
	h = 15;//高度
	addCount(); //慢慢打开
}

function noneAds(){
	
	panduan=false;
	if(h>hmin)	{
		h = hmin;
		setTimeout("noneAds()",1); 
	}
	else {
		h = hmin;
		document.getElementById("ads").style.display = "";
		return;
	}
	document.getElementById("ads").style.height = h+"px";
	document.getElementById("adsbtn").style.display = "";
	document.getElementById("adsbtncl").style.display = "none";

}