function ContentScroller(scrollname, div_name, left_name, right_name, up_name, down_name, scroll_action, scroll_bar, scroll_bar_bullet)
{
    this.div_name = div_name;
    this.name = scrollname;
    this.scrollCursor = 0;
    this.speed = 5;
    this.timeoutID = 0;
    this.div_obj = null;
    this.left_name = left_name;
    this.rht_name = right_name;
	this.up_name = up_name;
    this.dn_name = down_name;
	this.scroll_action = scroll_action;
	this.scrollbar = scroll_bar;
	this.scroll_bar_bullet = scroll_bar_bullet;

	this.scroll_bar_obj = null;
	this.scroll_bar_bullet_obj = null;

	this.scroll_bar_speed = 0;
	this.scroll_bar_cursor = 0;

	this.scrollCursorHeight = 170; // ammount to scroll to
	this.scrollBarCursorHeight = 240 // height of the scroll bar list


	this.scrollCursorMin = 0;
    {

		if (!this.scroll_action) this.scroll_action = 'onmouseover'; // set default as mouse over

	    if (document.getElementById) {
            div_obj = document.getElementById(this.div_name);


			if (this.scrollbar) {
				this.scroll_bar_obj = document.getElementById(this.scrollbar);
				this.scroll_bar_bullet_obj = document.getElementById(this.scroll_bar_bullet);


				if (navigator.appName == "Microsoft Internet Explorer") {
					this.scroll_bar_speed = this.scroll_bar_bullet_obj.scrollHeight / 2;
					this.scrollBarCursorHeight += 12;

					this.scrollCursorHeight -= 20;
					this.scrollCursorMin = 11;

				}
				else {
					this.scroll_bar_speed = this.scroll_bar_bullet_obj.scrollHeight / 3.2;
				}
			}

            if (div_obj) {
                this.div_obj = div_obj;
                this.div_obj.style.overflow = 'hidden';
            }
            div_left_obj = document.getElementById(this.left_name);
            div_rht_obj = document.getElementById(this.rht_name);

			div_up_obj = document.getElementById(this.up_name);
            div_dn_obj = document.getElementById(this.dn_name);

            if (div_left_obj && div_rht_obj) {
				_bindAction(div_left_obj, 'scrollLeft()', this.scroll_action);
				_bindAction(div_rht_obj, 'scrollRight()', this.scroll_action);
            }
			 if (div_up_obj && div_dn_obj) {
	               _bindAction(div_up_obj, 'scrollUp()', this.scroll_action);
				   _bindAction(div_dn_obj, 'scrollDown()', this.scroll_action);
            }
        }
    }

	function _bindAction(obj, bind_funct, scroll_action) {
		if (scroll_action == 'onmouseover') {
			obj.onmouseover = function() { eval(scrollname + "."+bind_funct+";"); };

	        obj.onmouseout = function() { eval(scrollname + ".stopScroll();"); };
		}
		else if (scroll_action == 'onclick') {
			obj.onmousedown = function() { eval(scrollname + "."+bind_funct+";"); };
	        obj.onmouseup = function() { eval(scrollname + ".stopScroll();"); };
		}
	}

    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()", 60);
        }
    }

    this.scrollRight = function() {
        if (this.div_obj) {
			this.scrollCursor = (this.scrollCursor + this.speed) > this.div_obj.scrollWidth ? this.div_obj.scrollWidth : this.scrollCursor + this.speed;

			//document.getElementById('deb').innerHTML = this.div_obj.scrollWidth+' '+this.scrollCursor;
            this.div_obj.scrollLeft = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollRight()", 60);
        }
    }

    this.scrollUp = function() {
        if (this.div_obj) {
			if (this.scrollCursor > this.scrollCursorMin) {
	            this.scrollCursor -= this.speed;
	            this.div_obj.scrollTop = this.scrollCursor;
				dir = 'UP';
				if (this.scrollbar) this.scrollScrollBar(dir);


	            this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
			}
			else {
				this.scrollCursor = this.scrollCursorMin;
			}
        }
    }

    this.scrollDown = function() {


        if (this.div_obj) {

			if (this.scrollCursor < this.scrollCursorHeight) { // FF 170 IE 150
	            this.scrollCursor += this.speed;
	            this.div_obj.scrollTop = this.scrollCursor;
				dir = 'DOWN';
				if (this.scrollbar) this.scrollScrollBar(dir);

	            this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
			}
			else {
				this.scrollCursor = this.scrollCursorHeight;
			}
        }
    }

	this.scrollScrollBar = function(dir) {
			// test scroll code
			scroll_bar1 = document.getElementById(this.scrollbar);
			scroll_bar_bullet = document.getElementById(this.scroll_bar_bullet);

			//document.getElementById('deb').innerHTML = scroll_bar1.scrollHeight+' '+scroll_bar1.offsetTop+' '+this.scroll_bar_cursor;





			if (dir == 'UP') 	this.scroll_bar_cursor -= this.scroll_bar_speed;
			else 				this.scroll_bar_cursor += this.scroll_bar_speed;

			scroll_bar_bullet.style.top = this.scroll_bar_cursor;

			if (this.scroll_bar_cursor < scroll_bar1.offsetTop) {
				this.scroll_bar_cursor = scroll_bar1.offsetTop;
			}
			else if (this.scroll_bar_cursor > this.scrollBarCursorHeight){
				this.scroll_bar_cursor = this.scrollBarCursorHeight; //FF 242 IE
			}

			scroll_bar_bullet.style.top = this.scroll_bar_cursor;
	}

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

    this.setScrollCursor = function(pos) {

    	if (pos > 500) {
    	 	this.scrollCursor = 500;
    	}
    	else if (pos < 0) {
    		this.scrollCursor = 0;
    	}
    	else {
    	 	this.scrollCursor = pos;
    	}

		this.div_obj.scrollLeft = this.scrollCursor;
    }
}