function newsScroller(id, rowHeight, interval)
{
	var thisObj = this;
	this.box = document.getElementById(id);
	this.box.style.overflow = "hidden";
	this.box.parent = this;

	this.rows = new Array();
	this.height = this.box.clientHeight;
	this.width = this.box.clientWidth;
	this.rowH = rowHeight;
	this.interval = interval;
	this.timeobj = null;

	if (typeof this.rowH != "number") this.rowH = 25;
	if (typeof this.interval != "number") this.interval = 50;
	if (this.interval < 0) this.interval = 0;

	// Add table
	var Table = this.box.appendChild(document.createElement("TABLE"));
	this.innerBox = Table.appendChild(document.createElement("TBODY"));
	Table.border = 0;
	Table.cellPadding = 0;
	Table.cellSpacing = 0;
	Table.onmouseover = function(){thisObj.stop()};
	Table.onmouseout = function(){thisObj.start()};
}

newsScroller.prototype.add = function (link, txt, Target)
{
	var TR = this.innerBox.appendChild(document.createElement("TR"));
	var TD = TR.appendChild(document.createElement("TD"));
	var A = TD.appendChild(document.createElement("A"));

	TR.style.height = this.rowH + "px";
	TD.vAlign = "middle";
	TD.align = "left";
	//TD.noWrap = true;

	A.href = link;
	A.className = "newsScroller";
	A.innerHTML = txt;
//	A.title = txt;
	if (typeof Target != "undefined") A.target = Target;

	this.rows[this.rows.length] = TR;
}

newsScroller.prototype.remove = function (idx)
{
	if (this.rows.length > idx) {
		return this.innerBox.removeChild(this.rows[idx]);
	}
}

newsScroller.prototype.start = function ()
{
	if (this.interval == 0) return;

	this.box.scrollTop++;
	if (this.box.scrollTop > this.rowH) {
		this.innerBox.appendChild(this.rows[0]);
		this.rows[this.rows.length] = this.rows[0];
		this.rows.shift();
		this.box.scrollTop = 1;
	}

	this.timeobj = setTimeout("(document.getElementById('"+this.box.id+"')).parent.start()", this.interval);
}

newsScroller.prototype.stop = function ()
{
	if (this.timeobj != null) clearTimeout(this.timeobj);
}