	

	var timer, offset;



	/* DHTML micro API */

	function getObj(name) {

		if (document.getElementById) {

			this.obj = document.getElementById(name);

			this.style = document.getElementById(name).style;

		} else if (document.all) {

			this.obj = document.all[name];

			this.style = document.all[name].style;

		} else if (document.layers) {

			this.obj = document.layers[name];

			this.style = document.layers[name];

		}

		

		this.x;

		this.y;

	}



	function initScroll(containerLayer, scrollLayer, containerWidth) {

		objContainer = new getObj(containerLayer);

		objContent = new getObj(scrollLayer);

		objContainer.style.visibility = 'visible';

		objContainer.style.width = containerWidth;

		offset = objContent.obj.offsetWidth - containerWidth;

		

		speed = 10;

		step = 2;

		

		move(0,0); // Initial move

	}

	

	function move(x, y) {

		objContent.x = x;

		objContent.y = y;



		objContent.style.left = objContent.x;	

		objContent.style.top = objContent.y;

	} 

	

	function scroll_left(speed) {

		if (objContent.x < 0) {

			move(objContent.x + step, 0);

			timer = setTimeout('scroll_left('+speed+')', speed);

		}

	}

	

	function scroll_right(speed) {

		if (objContent.x > -offset) {

			move(objContent.x - step, 0);

			timer = setTimeout('scroll_right('+speed+')', speed);

		}

	}

	

	function stop_scroll() {

		if (timer) {

			clearTimeout(timer);

		}

	}



	