function TextScroll(scrollname, div_name, up_name, down_name)
{
this.div_name = div_name;
this.name = scrollname;
this.scrollCursor = 0;
this.speed = 20;
this.timeoutID = 0;
this.div_obj = null;
this.up_name = up_name;
this.dn_name = down_name;

{
if (document.getElementById) {
div_obj = document.getElementById(this.div_name);
if (div_obj) {
this.div_obj = div_obj;
this.div_obj.style.overflow = 'hidden';
}
div_up_obj = document.getElementById(this.up_name);
div_dn_obj = document.getElementById(this.dn_name);
if (div_up_obj && div_dn_obj) {
div_up_obj.onmousedown = function() { eval(scrollname + ".scrollUp();") };
div_up_obj.onmouseup = function() { eval(scrollname + ".stopScroll();") };

div_dn_obj.onmousedown = function() { eval(scrollname + ".scrollDown();") };
div_dn_obj.onmouseup = function() { eval(scrollname + ".stopScroll();") };
}
}
}

this.stopScroll = function() {
clearTimeout(this.timeoutID);
}

this.scrollUp = function() {
gL=getLeft('main');
if (this.div_obj && gL<485) {
new Effect.Move ('main',{ x: this.speed, y: 0, mode: '', duration: 0.1});
//this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed; x=x-this.speed;
//this.div_obj.scrollLeft = this.scrollCursor;
this.timeoutID = setTimeout(this.name + ".scrollUp()", 1);
}
}

this.scrollDown = function() {
gL=getLeft('main');
if (this.div_obj) {
var moveAmount = -this.speed;
new Effect.Move ('main',{ x: -this.speed, y: 0, mode: '', duration: 0.1});
//this.scrollCursor += this.speed; x=x+this.speed;
//this.div_obj.scrollLeft = this.scrollCursor;
if (this.div_obj.scrollLeft == this.scrollCursor) {
this.timeoutID = setTimeout(this.name + ".scrollDown()", 1);
} else {
this.scrollCursor = this.div_obj.scrollLeft;
}
}
}

this.resetScroll = function() {
if (this.div_obj) {
this.div_obj.scrollLeft = 0;
this.scrollCursor = 0;
}
}
}
