	// From http://blog.firetree.net/2005/07/04/javascript-find-position/
	function findPosX(obj) {
	var curleft = 0;
	if(obj.offsetParent)
		while(1) {
			curleft += obj.offsetLeft;
			if(!obj.offsetParent)
				break;
			obj = obj.offsetParent;
		}
		else if(obj.x)
			curleft += obj.x;
		return curleft;
	}

	// Original from http://www.dynamicdrive.com
	//specify speed of scroll (greater=faster)
	var hiSpeed = 25;
	var slowSpeed = 1;
	var speed = hiSpeed;
	
	var pingPong = "left";
	
	function moveRight() {
		if (parseInt(toScroll.style.left) >= (toScrollWidth*(-1)+940)) {
			toScroll.style.left=parseInt(toScroll.style.left)-speed+"px";
			return true;
		} else {
			return false;
		}
	}

	function moveLeft() {
		if (parseInt(toScroll.style.left) <= 0) {
			toScroll.style.left=parseInt(toScroll.style.left)+speed+"px";
			return true;
		} else {
			return false;
		}
	}
	
	// Original from http://www.codelifter.com/main/javascript/capturemouseposition1.html	
	document.onmousemove = getMouseXY;
	
	// Temporary variables to hold mouse x-y pos.s
	var mouseX = 0;
	var mouseY = 0;

	// Main function to retrieve mouse x-y pos.s
	function getMouseXY(event) {
		mouseX = event.clientX + document.body.scrollLeft;
		mouseY = event.clientY + document.body.scrollTop;
		return true;
	}
	
	function doScroll() {
		margin = 150;
		xPos = findPosX(container);
		yPos = 163;
		sWidth = container.offsetWidth;
		sHeight = container.offsetHeight;

		if (mouseX > xPos && mouseX < (xPos + sWidth) && mouseY > yPos) {
			speed = hiSpeed;
			if (mouseX > xPos && mouseX < (xPos + margin)) {
				// Scroll left
				moveLeft();
			} else if (mouseX > (xPos + sWidth - margin) && mouseX < (xPos + sWidth)) {
				// Scroll right
				moveRight();
			}
		} else {
			// auto scroll
			speed = slowSpeed;
			if (pingPong == "left" && moveLeft() == false) pingPong = "right";
			if (pingPong == "right" && moveRight() == false) pingPong = "left";
			//alert("AUTO");
		}

		checkMouseVar = setTimeout("doScroll()",20);
	}
