﻿	var scroll;
	var scrollcontainer;
	var step;
	var pause;

	left = 0;
	step = 1;

	function initScroll(step, speed) {
	
	    pause = false;
	
		this.step = step;
	
		scrollcontainer = document.getElementById("scrollcontainer");
		scrollcontainer.style.position="relative";
	
		scrollcontainer.style.clip = "rect(0px " + (parseInt(scrollcontainer.style.width.replace("px", "")) + 2) + "px " + (parseInt(scrollcontainer.style.height.replace("px", "")) + 2) + "px 0px)";
	
		scroll = document.getElementById("scroll");
		scroll.style.position="absolute";
		//left = getWindowWidth() + 50;
		left = 350;
		scroll.style.left = left + "px";

		var scrollInterval = setInterval ( "doScroll()", speed);
	}

	function doScroll() {
	    if (!pause) {
		    left = left - step;
		    scroll.style.left = left + "px";
		    //if(left < 0 - (scroll.offsetWidth)) {
			//    left = getWindowWidth() + 50;
		    //}
		    if(left < 0 - (scroll.offsetWidth)) {
			    left = 700 + 50;
		    }
	    }
	}
	
	function doPause() {
	    pause = true;
	}
	
	function undoPause() {
	    pause = false;
	}
	
	function slowDown() {
	    step = step / 2;
	}
	
	function speedUp() {
	    step = step * 2;
	}
	
	function zoomIn() {
		var i;
		var fontSize;
		fontSize = 25; 
		for (i = fontSize; i <= fontSize + 10; i++) {
			scroll.style.fontSize = i + "px";			
			scrollcontainer.style.height = i + 5 + "px";
		}
	}
	
	function zoomOut() {
		var i;
		var fontSize;
		fontSize = 45; 
		for (i = fontSize; i >= fontSize - 20; i--) {
			scroll.style.fontSize = i + "px";
			scrollcontainer.style.height = i + 5 + "px";
		}
	}
	
	//function pause(milliseconds) {
	//	var dt = new Date();
	//	while ((new Date()) - dt <= milliseconds) {  };
	//}
	
	function getStyle(el,styleProp) {
		var x = document.getElementById(el);
		if (x.currentStyle)
			var y = x.currentStyle[styleProp];
		else if (window.getComputedStyle)
			var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
		return y;
	}

	function getWindowWidth() {
		if (parseInt(navigator.appVersion)>3) {
		 if (navigator.appName=="Netscape") {
		  return window.innerWidth;
		  winH = window.innerHeight;
		 }
		 if (navigator.appName.indexOf("Microsoft")!=-1) {
		  return document.body.offsetWidth;
		  winH = document.body.offsetHeight;
		 }
		}
	}
	
	function getWindowHeight() {
		if (parseInt(navigator.appVersion)>3) {
		 if (navigator.appName=="Netscape") {
		  return window.innerHeight;
		 }
		 if (navigator.appName.indexOf("Microsoft")!=-1) {
		  return document.body.offsetHeight;
		 }
		}
	}

