function scroller(objname,width,height){
	this.scrollerInterval=new Array(); //定义一些常用而且要经常用到的变量 
	this.scrollerId=0; 
	this.scrollerDelay=3500; 
	this.scrollerHeight=240;
	this.scrollerWidth=730;
	this.slideimages=new Array();
	this.name='';
	this.scrollerBox=null;
	
	if (width!=null){this.scrollerWidth=width;}
	if (height!=null){this.scrollerHeight=height;}
	//接下来的是定义一些要使用到的函数 
	this.init=function(parent,ary){
		this.name=objname;
		this.slideimages=ary;
		if (this.name=="" || this.slideimages.length<=0){return;}
		var str=this.slideimages[0]; 
		var parentobj=document.getElementById(parent);
		if (parentobj==null){alert('容器装载出错！！！');return;}
		parentobj.innerHTML='<span><div id=\"'+this.name+'_scrollerBox\" style="overflow:hidden;height:'+this.scrollerHeight+'px;width:'+this.scrollerWidth+'px" onmouseover="clearInterval('+this.name+'.scrollerInterval[0])" onmouseout="'+this.name+'.scrollerInterval[0]=setInterval(\''+this.name+'.startscroller()\','+this.name+'.scrollerDelay)"><div>'+str+'</div></div></span>'; 
		this.initscroller();
	}
	this.initscroller=function() { 
		this.scrollerBox=document.getElementById(this.name+"_scrollerBox");
		this.scrollerId++; 
		this.scrollerInterval[0]=setInterval(this.name+".startscroller()",this.scrollerDelay); 
	} 
	this.startscroller=function() { 
		var str=this.slideimages[this.scrollerId]; 
		this.scrollerId++; 
		if(this.scrollerId>=this.slideimages.length) this.scrollerId=0; 
		if(this.scrollerBox.childNodes.length==1) { 
			var nextLine=document.createElement('DIV'); 
			nextLine.innerHTML=str; 
			this.scrollerBox.appendChild(nextLine); 
		}else { 
			this.scrollerBox.childNodes[0].innerHTML=str; 
			this.scrollerBox.appendChild(this.scrollerBox.childNodes[0]); 
			this.scrollerBox.scrollTop=0; 
		} 
		clearInterval(this.scrollerInterval[1]); 
		this.scrollerInterval[1]=setInterval(this.name+".scrollscroller()",30); 
	} 
	this.scrollscroller=function() { 
		this.scrollerBox.scrollTop=this.scrollerBox.scrollTop+10; 
		if(this.scrollerBox.scrollTop%this.scrollerHeight==(this.scrollerHeight-1)){ 
			clearInterval(this.scrollerInterval[1]); 
		} 
	}
}