



//scrollBodyId:	String 内部滚动div的id
//scrollBoxId:	String 外面限制div的id
//showHeight:	Int 限制显示高度
//showWidth:	Int 限制显示宽度
//lineHeight:	Int 每行的高度
//stopTime:		Int 间隔停止的时间（毫秒）
//speed:		Int 滚动速度（毫秒，越小越快）
var ScrollObj = function(scrollBodyId,scrollBoxId,showHeight,showWidth,lineHeight,stopTime,speed) {
	this.obj = document.getElementById(scrollBodyId);
	this.box = document.getElementById(scrollBoxId);
	
	this.style = this.obj.style;
	this.defaultHeight = this.obj.offsetHeight;
	
	this.obj.innerHTML += this.obj.innerHTML;
	this.obj.style.position = "relative";
//	this.obj.style.position = "static";

//	this.obj.style.height = showHeight;	
	this.box.style.height = showHeight;
	this.box.style.width = showWidth;
	this.box.style.overflow = "hidden";
	
	this.scrollUp = doScrollUp;

	this.stopScroll = false;
	
	this.curLineHeight = 0;
	this.lineHeight = lineHeight;
	this.curStopTime = 0;
	this.stopTime = stopTime;
	this.speed = speed;

	this.style.top = lineHeight+"px";

	this.object = scrollBodyId + "Object";
	eval(this.object + "=this");
	setInterval(this.object+".scrollUp()",speed);
	this.obj.onmouseover=new Function(this.object+".stopScroll=true");
	this.obj.onmouseout=new Function(this.object+".stopScroll=false");
}
function doScrollUp(){
	if( this.stopScroll == true )
		return;
  	this.curLineHeight += 1;
  	if( this.curLineHeight >= this.lineHeight ){
  		this.curStopTime += 1;
  		if( this.curStopTime >= this.stopTime ){
  			this.curLineHeight = 0;
  			this.curStopTime = 0;
  		}
  	}
	else{  	
	  	this.style.top = parseInt(this.style.top) - 1+"px";
	  	if( -parseInt(this.style.top) >= this.defaultHeight ){
	    	this.style.top = 0+"px";
	  	}
  	}
}
//*********************************

if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0))
	{
			marqueesHeight=25;
			stopscroll=false;
			with(scroollBody){
				style.width=0;
				style.height=marqueesHeight;
				style.overflowX="visible";
				style.overflowY="hidden";
				noWrap=true;
				onmouseover=new Function("stopscroll=true");
				onmouseout=new Function("stopscroll=false");
			}
			preTop=0; currentTop=marqueesHeight; stoptime=0;
			scroollBody.innerHTML+=scroollBody.innerHTML;


			function init_srolltext(){
			scroollBody.scrollTop=0;
			setInterval("scrollUp()",40);
			}init_srolltext();

			function scrollUp(){
			if(stopscroll==true) return;
			currentTop+=1;
			if(currentTop==(marqueesHeight+1))
			{
			   stoptime+=1;
			   currentTop-=1;
			   if(stoptime==300)
			   {
			currentTop=0;
			stoptime=0;    
			   }
			}
			else {
			preTop=scroollBody.scrollTop;
			scroollBody.scrollTop+=1;
			if(preTop==scroollBody.scrollTop){
			scroollBody.scrollTop=marqueesHeight;
			scroollBody.scrollTop+=1;

			}
			}

			}

		thisobj.innerHTML=text;
		init_srolltext();
		
		}
	else if ( (navigator.userAgent.indexOf('Firefox') >= 0) || (navigator.userAgent.indexOf('Chrome') >= 0))
		{
			thisobj.innerHTML=text;
			var sample = new ScrollObj("scroollBody","scroollBox",25,500,26,150,30);
			}
	else
		{
		thisobj.innerHTML=text1;
		}










