<!-- // hide from older browsers

/*
 * Script ©2001-2002 Sparkshire Designs.  Written by Susan Sparks.
 * Please do not use without permission.
 *
 */

increment=1;		//amount of each movement (in pixels) 
time=50;		//speed of scrolling
tw=120;			//width of scrolling window
th=200;			//height of actual scrolling window
srcHeight = 475; 	//height of text file being scrolled
startPos=th;		//sets the first line of text at the bottom of the text window
topPos = 200;		//top edge of scrollbox
$firstScroll = 1;  // check to see if it is the initial scroll

endLimit = srcHeight*-1;

function initScroll() {

	if (document.all) {

		pageWidth=document.body.clientWidth; //record width & height of window
		pageHeight=document.body.clientHeight;
	}
	
	if (document.layers) {
		document.scrollBorder.pageX = window.innerWidth - (tw + 50);
		document.scrollBorder.pageY = topPos + 7;
		document.scrollBoxLyr.pageX = window.innerWidth - (tw + 45);
		document.scrollBoxLyr.pageY = topPos + 10;
		document.scrollBoxLyr.clip.left = 0;
		document.scrollBoxLyr.clip.top = 0;
		document.scrollBoxLyr.clip.height = th;
		document.scrollBoxLyr.clip.width = tw;
		document.scrollBoxLyr.document.textBoxLyr.top = startPos;
		if ($firstScroll) {
			document.scrollBoxLyr.document.textBoxLyr.load("scripts/scrollingText.htm",tw);
			$firstScroll = 0;
		}
		document.scrollBoxLyr.visibility="show";
		document.scrollBorder.visibility="show";
	} 
	else {
		document.all.textBoxDiv.innerHTML = document.text.textFile.value; //php used to load file in form
		document.all.scrollBorder.style.top= parseInt(topPos - 15) + "px";
		document.all.textBoxDiv.style.top = startPos + "px";
		document.all.textBoxDiv.style.visibility="visible";
		document.all.scrollBorder.style.visibility="visible";
		if (navigator.appName.indexOf("Microsoft") != -1) {
			document.all.scrollBoxDiv.style.left= parseInt(document.body.clientWidth - (tw + 20)) + "px";
			document.all.scrollBorder.style.left= parseInt(document.body.clientWidth - (tw + 35)) + "px";
		}
		else { //position layers in nn6
			document.all.scrollBoxDiv.style.left= parseInt(window.innerWidth - (tw + 45)) + "px";
			document.all.scrollBorder.style.left= parseInt(window.innerWidth - (tw + 60)) + "px";
		}
	}	
		newPos = startPos;
		scrollText();
}

function scrollText() {

	if (document.all) {
	//if window is resized, refresh page to reset scrolling text
	  if (document.body.clientWidth != pageWidth || document.body.clientHeight != pageHeight) {
	  	location.reload();
	  }
	}
	  
	if (document.layers) {
	  if (eval(document.scrollBoxLyr.document.textBoxLyr.top) > endLimit) {
		newPos -= increment;
		document.scrollBoxLyr.document.textBoxLyr.top = newPos;
	  }
	  else {
		clearTimeout(scroller);
		initScroll();
		return;
	  }
	}
	else {
	  if (parseInt(document.all.textBoxDiv.style.top) > endLimit) {
		newPos -= increment;
		document.all.textBoxDiv.style.top = newPos;
	  }
	  else {
		clearTimeout(scroller);
		initScroll();
		return;
	  }
	}
		
	scroller = setTimeout('scrollText()', time);
}

function pause() {
	clearTimeout(scroller);
}

function setCapture() {
	if (document.layers) {
		document.captureEvents (Event.ONMOUSEOVER | Event.ONMOUSEOUT);
		document.scrollBoxLyr.document.textBoxLyr.onMouseOver = function() {pause();}
		document.scrollBoxLyr.document.textBoxLyr.onMouseOut = function() {scrollText();}
	}
}
// -->
