// JavaScript Document
var hmax = 245-1;//最大高度
var hmin = 25;//最小高度
var h=0;
var kk=1;
//addCount(); //慢慢打开
function addCount(){

	if(h<hmax){
		h += 20;
		setTimeout("addCount()",1); 
	}
	else {
		h=hmax;
		setTimeout("noneAds()",6000); //停留时间自己适当调整 1000 = 1秒
		document.getElementById("adsOPEN").style.display = "none";
	}
	document.getElementById("ads").style.display = "";
	document.getElementById("ads").style.height = h+"px";
}
window.onload = function showAds(){
	document.getElementById("ads").style.display = "none";
	document.getElementById("ads").style.height = "0px";
	
	addCount(); //慢慢打开
//	h=hmax; 
//	setTimeout("noneAds()",3000); //停留时间自己适当调整 1000 = 1秒
}
function openAds(){
	//if (kk==1)
	//{
		h = 0;//高度
	addCount(); //慢慢打开
	//}
	
}
function noneAds(){
	if(h>hmin)	{
		h -= 20;
		setTimeout("noneAds()",1); kk=0;
	}
	else {
		h = hmin;
		document.getElementById("ads").style.display = "none";
		document.getElementById("adsOPEN").style.display = "";
		return;
	}
	document.getElementById("ads").style.height = h+"px";kk=0;
}