var hmax = 340;//最大高度
var hmin = 0;//最小高度
var h=0;
function showAds()
	{
		document.getElementById("ads").style.display = "none";
		document.getElementById("ads").style.height = "0px";
		addCount(); //慢慢打开
	}
function addCount()
	{
		document.getElementById("adsOPEN").style.display = "none";
		if(h<hmax)
		{
			h += 10;
			setTimeout("addCount()",1); 
		}
		else
		{
			//h=hmax;
			setTimeout("closeAds()",15000); //停留时间自己适当调整 1000 = 1秒
		}
		document.getElementById("ads").style.display = "block";
		document.getElementById("ads").style.height = h+"px";
	}
function initEcAd2() 
	{
	document.all.adsOPEN.style.posTop = -200;
	document.all.adsOPEN.style.visibility = 'visible'
	MoveLeftLayer2('adsOPEN');
	}
function MoveLeftLayer2(layerName) 
	{
	var x = 5;
	var y = 40;// 左侧广告距离页首高度
	var diff = (document.body.scrollTop + y - document.all.adsOPEN.style.posTop)*.40;
	var y = document.body.scrollTop + y - diff;
	eval("document.all." + layerName + ".style.posTop = parseInt(y)");
	eval("document.all." + layerName + ".style.posLeft = x");
	setTimeout("MoveLeftLayer2('adsOPEN');", 20);
	}
function openAds()
	{
		h = 0;//高度
		addCount(); //慢慢打开
	}
function closeAds()
	{
	if(h>hmin) 
		{
			h -= 10;
			setTimeout("closeAds()",1); 
		}
	else
		{
			//h=hmin;
			document.getElementById("ads").style.display = "none";
			document.getElementById("adsOPEN").style.display = "block";
			initEcAd2()
			return;
		}		
	document.getElementById("ads").style.height = h+"px";
	}
