// 首页移动广告位
/**
var intervalId = null; 
function slideAd(id,nStayTime,sState,nMaxHth,nMinHth){ 

	this.stayTime=nStayTime*1000 || 3000; //默认广告显示周期
   	this.maxHeigth=nMaxHth || 260; //展开大小
   	this.minHeigth=nMinHth || 1; //缩回最小
   	this.state=sState || "down" ; //是打开还是关闭 默认打开
	
   	var obj = document.getElementById(id); 
	
   	if(intervalId != null)window.clearInterval(intervalId); 
   		
	function openBox(){ 
    	var h = obj.offsetHeight; 
    	obj.style.height = ((this.state == "down") ? (h + 2) : (h - 2))+"px"; 
     	if(obj.offsetHeight>this.maxHeigth){ 
     		window.clearInterval(intervalId); 
     		intervalId=window.setInterval(closeBox,this.stayTime); 
     	} 
     	if(obj.offsetHeight<this.minHeigth){ 
     		window.clearInterval(intervalId); 
     		obj.style.display="none"; 
     	} 
   	} 
   	function closeBox(){ 
    	slideAd(id,this.stayTime,"up",nMaxHth,nMinHth); 
   	} 
   	intervalId = window.setInterval(openBox,50); 
}
<div id="MoveAd" style="overflow:hidden; margin:0 auto; width:980px;height:260px; background-color:#FFF; text-align:center;">
	<a href="http://www.ggzhe.cn/" target="_blank"><img src="adimages/adbannermove.jpg" border="0"/></a>
</div>
//调用方法<script type="text/javascript">slideAd('MoveAd',3,'down',260,1);</script>
**/

	var time = 500;
	var h = 0;
	function addCount(){
        if(time>0){
            time--;
            h = h+5;
        }else{
            return;
        }
        if(h>280){
            return;
        }
        document.getElementById("MoveAd").style.display = "";
        document.getElementById("MoveAd").style.height = h+"px";
        setTimeout("addCount()",30); 
    }
    window.onload = function showAds()
    {
        addCount();
        setTimeout("noneAds()",10000); //停留时间自己适当调整
    }
	
    var T = 500;
    var N = 260; //高度
    function noneAds(){
        if(T>0){
            T--;
            N = N-5;
        }else{
            return;
        }
        if(N<0){
            document.getElementById("MoveAd").style.display = "none";
            return;
        }
        document.getElementById("MoveAd").style.height = N+"px";
        setTimeout("noneAds()",30); 
    }
	/**
	调用方法
	<div id="MoveAd" style="overflow:hidden; margin:0 auto; width:980px;height:260px; background-color:#FFF;  display:none; text-align:center;">
	<a href="http://www.ggzhe.cn/" target="_blank"><img src="adimages/adbannermove.jpg" border="0"/></a>
	</div>
	*/
