var TScroll=Class();
TScroll.prototype={
	initialize:function(obj, objs,times,p,w){
		var oTscro=this;
		this.stopscroll = false;
		this.scrollElem = $(obj);
		this.marqueesHeight = this.scrollElem.style.height;
		this.scrollElem.onmouseover = $F.bind(new Function('this.stopscroll = true'),this);
		this.scrollElem.onmouseout = $F.bind(new Function('this.stopscroll = false'),this);
		this.preTop=0;
		this.t=times;
		this.longScroll=p||2;
		this.waitTime=w||4;
		this.currentTop=0;
		this.stoptime=0;
		this.leftElem=$(objs);
	},
	star:function(){
		this.scrollElem.appendChild(this.leftElem.cloneNode(true));
		this.init(); 
	},
	init:function(){ 
		this.scrollElem.scrollTop = 0; 
		setInterval($F.bind(this.scrollUp,this), this.t);//的面的这个参数25, 是确定滚动速度的, 数值越小, 速度越快 
	}, 
	scrollUp:function (){ 
		if(this.stopscroll) return; 
		this.currentTop += this.longScroll; //设为1, 可以实现间歇式的滚动; 设为2, 则是连续滚动 
		if(this.currentTop == 19) { 
			this.stoptime += 1; 
			this.currentTop -= 1; 
			if(this.stoptime == 180) { 
				this.currentTop = 0; 
				this.stoptime = 0; 
			} 
		}else{ 
			this.preTop = this.scrollElem.scrollTop; 
			this.scrollElem.scrollTop += 1; 
			if(this.preTop == this.scrollElem.scrollTop){ 
				this.scrollElem.scrollTop = 0; 
				this.scrollElem.scrollTop += 1; 
			} 
		} 
	} 
}
