 // gives up and down scroll buttons to images, spans, ... named up_name, down_name, respectively.// will keep the default scroll_box's style overflow if it encounters errors (so make overflow: auto;)// usage: put this after the scrollbox div:  var div_scroll1 = new TextScroll("div_scroll1", "scroll_box")function TextScroll (scrollname, div_name, up_name, down_name, button_div_name, section){
    this.section = section;    this.div_name = div_name;
    this.button_div_name = button_div_name;    this.name = scrollname;    this.scrollCursor = 0;    this.speed = 5;    this.timeoutID = 0;    this.div_obj = null;    this.up_name = up_name;    this.dn_name = down_name;    { /* constructor */        if (document.getElementById) {
            div_obj = document.getElementById(this.div_name);            if (div_obj) {                this.div_obj = div_obj;                this.div_obj.style.overflow = "hidden";            }
	    //console.log("init '"+scrollname+"': scrollTop="+this.div_obj.scrollTop+" | scrollHeight="+this.div_obj.scrollHeight);            div_up_obj = document.getElementById(this.up_name);            div_dn_obj = document.getElementById(this.dn_name);
		            if (div_up_obj && div_dn_obj) {
		if (typeof(div_up_obj.setAttribute) == "function") {
			div_up_obj.setAttribute("onmouseover", scrollname + ".scrollUp();", 1);                	div_up_obj.setAttribute("onmouseout", scrollname + ".stopScroll();", 1);
		} else {
			div_up_obj.onmouseover = scrollname+".scrollUp();";
                	div_up_obj.onmouseout = scrollname+".stopScroll();";
		}
		
		if (typeof(div_dn_obj.setAttribute) == "function") {
			div_dn_obj.setAttribute("onmouseover", scrollname + ".scrollDown();", 1);                	div_dn_obj.setAttribute("onmouseout", scrollname + ".stopScroll();", 1);
		} else {
			div_dn_obj.onmouseover = scrollname+".scrollDown();";                	div_dn_obj.onmouseout = scrollname+".stopScroll();";
		}
		
            }        }    } /* end constructor */    this.stopScroll = function() {
	//console.log("stopScroll: Timeout ID="+this.timeoutID);        clearTimeout(this.timeoutID);    }    this.scrollUp = function() {
	if (this.div_obj) {
	
		this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
		this.div_obj.scrollTop = this.scrollCursor;
		
		//console.log("scrollDown: scrollCursor="+this.scrollCursor);
		//console.log("scrollDown: scrollTop="+this.div_obj.scrollTop);
		//console.log("scrollDown: scrollHeight-offsetHeight="+(this.div_obj.scrollHeight-this.div_obj.offsetHeight));

		if (this.scrollCursor > 0) {
			//console.log("scrollUp: both buttons");
			s = makeScroller(this.section, 'Both');
			//console.log(s);
			document.getElementById(this.button_div_name).innerHTML = s;
			
			this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
			//console.log("scrollDown: setTimeout="+this.timeoutID);
			
		} else {
			//console.log("scrollUp: just down button");
			s = makeScroller(this.section, 'Down');
			//console.log(s);
			document.getElementById(this.button_div_name).innerHTML = s;
			
			//console.log("scrollDown: no setTimeout");
		}
		
		
	} /* end if div_obj */    } /* end function scrollUp */    this.scrollDown = function() {        if (this.div_obj) {
		
		this.scrollCursor += this.speed;
		this.div_obj.scrollTop = this.scrollCursor;
		
		//console.log("scrollDown: scrollCursor="+this.scrollCursor);
		//console.log("scrollDown: scrollTop="+this.div_obj.scrollTop);
		//console.log("scrollDown: scrollHeight-offsetHeight="+(this.div_obj.scrollHeight-this.div_obj.offsetHeight));
		
		if (this.scrollCursor < (this.div_obj.scrollHeight-this.div_obj.offsetHeight)) {
			//console.log("scrollDown: both buttons");
			s = makeScroller(this.section, 'Both');
			//console.log(s);
			document.getElementById(this.button_div_name).innerHTML = s;
			
			this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
			//console.log("scrollDown: setTimeout="+this.timeoutID);
			
		} else {
			//console.log("scrollDown: just up button");
			s = makeScroller(this.section, 'Up');
			//console.log(s);
			document.getElementById(this.button_div_name).innerHTML = s;
			
			//console.log("scrollDown: no setTimeout");
		}
		
	} /* end if div_obj */
    } /* end function scrollDown */    this.resetScroll = function() {        if (this.div_obj) {            this.div_obj.scrollTop = 0;            this.scrollCursor = 0;        }    }
    } /* end class */