
	/* define variables for "if n4 (Netscape 4), if IE (IE 4.x), and if n6 (if Netscape 6/W3C-DOM compliant)" */
	var n4, ie, n6;
	
	/* detecting browser support for certain key objects/methods and assembling a custom document object */
	var doc,doc2,doc3,sty;
	
	if (document.layers) {
		doc = "document.";
		doc2 = ".document.";
		doc3 = "";
		sty = "";
		n4 = true;
	} else if (document.all) {
		doc = "document.all.";
		doc2 = "";
		doc3 = "";
		sty = ".style";
		ie = true;
	} else if (document.getElementById) {
		doc = "document.getElementById('";
		doc2 ="')";
		doc3 ="')";
		sty = "').style";
		n6 = "true";
	} 

	/* The scrolling text box script. Always use together with docobj.js! */
	
	// the timer variables, for cleanup later.
	var timer1, timer2;
	
	// the scroll speed. The higher the number, the slower it scrolls.
	var scrollspeed = 100; 
	
	// initalize the variable that will serve as a 'load checker'
	var loaded=0;

	//the object constructor's core function
	function createObject(elem,container) {
		if (document.layers) {
			if (container) {
				container = doc +container+".";
			} else {
				container = "";
			}
			this.element = eval(container+doc + elem);
			this.styleElem = eval(container +doc+ elem);
			this.elemheight = this.styleElem.document.height;
			this.clipheight = this.styleElem.clip.height;
		} else if (document.all) {
			this.element = document.all[elem];
			this.styleElem = document.all[elem].style;
			this.elemheight = this.element.offsetHeight;
			this.clipheight = this.element.offsetHeight;
		} else if (document.getElementById) {
			this.element = document.getElementById(elem);
			this.styleElem = document.getElementById(elem).style;
			this.elemheight = this.element.offsetHeight;
			this.clipheight = this.element.offsetHeight;
		} else {
			return false;
		}
		this.scrollIt = scrollIt;
		this.scrollup = scrollup; 
		this.scrolldown = scrolldown;
		this.scroller = scroller;
		this.arrowImg = arrowImg;
		return this; 
	}

	//the basic function to make the textbox div move
	function scrollIt(xpos,ypos) {
		this.x=xpos; 
		this.y=ypos;
		this.styleElem.left = xpos;
		this.styleElem.top = ypos;
	}

	var minheight, contbox, textbox;
	
	/* function to make the textbox div move up, giving the viewer the illustion that she is scrolling the frame down. */
	function scrolldown (incr) {
		minheight = this.elemheight - contbox.clipheight;
		if (this.y > - minheight) {
			this.scrollIt(0,this.y-incr);
			if (loop == 1) {
				timer1 = setTimeout(("textbox.scrolldown("+incr+")"),scrollspeed)
			}
		}
	}

	/* function to make the text box div move down, giving the viewer the illustion that she is scrolling the frame up. */
	function scrollup (incr) {
		if (this.y < 0) {
			this.scrollIt(0,this.y-incr);
			if (loop == 1) {
				timer2 = setTimeout("textbox.scrollup("+incr+")",scrollspeed);
			}
		}
	}

	//Calls the scrolling functions. Also checks whether the page is loaded or not.
	function scroller(elem,incr){
		contbox=eval("box"+elem);
		textbox=eval("text"+elem);
		if(loaded == 1){
			loop=1;
			arrowImg(elem);
			if(incr > 0){
				textbox.scrolldown(incr)
			} else {
				textbox.scrollup(incr)
			}
		}
	}
	
	//Stops the scrolling (called on mouseout)
	function stopscroller(elem,arrowdir){
		loop=0; if (timer1) clearTimeout(timer1);
		arrowImg(elem,arrowdir);
	}

	//Make the arrow disappear when there is no more to scroll.
	function arrowImg(elem) {
		if (document.layers) {
			textelem_top = parseInt(eval(doc+elem+"box"+doc2+elem+"text.height"));
		} else {
			textelem = eval(doc + elem + "text" + sty);
			textelem_top = parseInt(textelem.top);
		}
		uparrow = eval (doc + elem + "up" + sty);
		downarrow = eval (doc + elem + "down" + sty);
	}

	// jumps to the top of the scrolling text. Called onclick.
	function toTop(elem) {
		textelem = eval('text'+elem);
		textelem.scrollIt(0,0);
	}