function Scroller(code)
{
	this.code = code;
	// scrolling speed, range from 1(slowest) - 10(fastest)
	this.speed = 3;
	this.pauseIt = 1;
	this.copySpeed = this.speed;
	this.pauseSpeed = (this.pauseIt==0)? this.copySpeed: 0;
	this.actualContentHeight = '';
	this.containerHeight = '';

	this.scroll = function()
	{
		if (parseInt(document.getElementById(this.code).style.top) > (this.actualContentHeight * (-1) + 8 ))
		{
			document.getElementById(this.code).style.top = parseInt(document.getElementById(this.code).style.top) - this.copySpeed + "px";
		}
		else
		{
			document.getElementById(this.code).style.top = parseInt(this.containerHeight) + 8 + 'px';
		}
	};

	this.playInterval = function ()
	{
		var _self = this;
		setInterval(function(){_self.scroll();}, 100);
	};

	this.run = function()
	{
		document.getElementById(this.code).style.top = 0;
		this.containerHeight = document.getElementById(this.code).parentNode.offsetHeight;
		this.actualContentHeight = document.getElementById(this.code).offsetHeight;

		if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1)
		{
			//if Opera or Netscape 7x, add scrollbars to scroll and exit
			document.getElementById(this.code).style.height = this.containerHeight + "px";
			document.getElementById(this.code).style.overflow = "scroll";
			return;
		}
	};

	this.stop = function()
	{
		this.copySpeed = this.pauseSpeed;
	};

	this.playInterval();
}
