function DivScroll(scrollname, div_name, left_name, right_name, offset) {
this.div_name = div_name;
this.name = scrollname;
this.scrollCursor = parseInt(offset);
this.speed = 7;
this.timeoutID = 0;
this.div_obj = null;
this.left_name = left_name;
this.right_name = right_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.left_name);
		div_dn_obj = document.getElementById(this.right_name);
		if (div_up_obj && div_dn_obj) {
			div_up_obj.onmouseover = function() { eval(scrollname + ".scrollLeft();") };
			div_up_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };
			
			div_dn_obj.onmouseover = function() { eval(scrollname + ".scrollRight();") };
			div_dn_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };
		}
	}
}
this.div_obj.scrollLeft = this.scrollCursor;

this.stopScroll = function() {
	clearTimeout(this.timeoutID);
}

this.scrollLeft = function() {
	if (this.div_obj) {
		this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
		this.div_obj.scrollLeft = this.scrollCursor;
		this.timeoutID = setTimeout(this.name + ".scrollLeft()", 50);
	}
}

this.scrollRight = function() {
	
//alert(this.scrollCursor);

	if (this.div_obj) {
		this.scrollCursor += this.speed;
		this.div_obj.scrollLeft = this.scrollCursor;
		if (this.div_obj.scrollLeft == this.scrollCursor) {
			this.timeoutID = setTimeout(this.name + ".scrollRight()", 50);
		} 
		else {
			this.scrollCursor = this.div_obj.scrollLeft;
		}
	}
}

this.resetScroll = function() {
	if (this.div_obj) {
		this.div_obj.scrollLeft = 0;
		this.scrollCursor = 0;
	}
}
} 
