function htScroller(elem)
{

	var scrollSpeed = 20;
	var scrollElem = elem;
	var scrollTimer = 0;
	var scrollMover = false;
	var scrollWidth = 0;
	var scrollPlaying = false;
	var scrollPlayingDir = "left";
		

	function init()
	{
		// Making the container element scrollable
		scrollElem.style.position = "relative";
				
		// Creating the inner-mover
		if(!scrollMover)
		{
			scrollMover = document.createElement("SPAN");
			scrollMover.innerHTML = scrollElem.innerHTML;
		}
		
		scrollMover.style.position = "absolute";
		scrollMover.style.top = "0px";
		scrollMover.style.left = "0px";
		
		// Attaching it
		scrollElem.innerHTML = "";
		scrollElem.appendChild(scrollMover);
		
		// Recording the original visible mover width
		scrollWidth = scrollMover.offsetWidth;
		
		// Starting the scroll loop
		scrollTimer = setInterval(scrollLeft, scrollSpeed);
	}
	this.scroll = init;
	
	
	function scrollLeft()
	{
		scrollPlaying = true;
		scrollPlayingDir = "left";
		
		// Scroll here
		var tempLeft = parseInt(scrollMover.style.left);
		tempLeft --;
		scrollMover.style.left = tempLeft + "px";
		
		// Finish
		if(document.all && (scrollWidth + parseInt(scrollMover.style.left) < scrollElem.offsetWidth))
		{
			clearInterval(scrollTimer);
			// Starting the scroll loop in the other direction this time
			scrollTimer = setInterval(scrollRight, scrollSpeed);
		}
		if(!document.all && scrollWidth == scrollMover.offsetWidth)
		{
			clearInterval(scrollTimer);
			// Starting the scroll loop in the other direction this time
			scrollTimer = setInterval(scrollRight, scrollSpeed);
		}
		
		// The visible width of the mover changes while scrolling
		scrollWidth = scrollMover.offsetWidth;
	}
	
	
	function scrollRight()
	{
		scrollPlaying = true;
		scrollPlayingDir = "right";
		
		// Scroll here
		var tempLeft = parseInt(scrollMover.style.left);
		tempLeft ++;
		scrollMover.style.left = tempLeft + "px";
		
		// Finish
		if(parseInt(scrollMover.style.left) == 0)
		{
			clearInterval(scrollTimer);
			// The entire scroll is done. Let's pause the scroller
			pause();
			scrollPlayingDir = "left";
		}
	}
	
	
	// Stop the scroll, go back to the start, remove the mover
	function rewind()
	{
		scrollPlaying = false;
		clearInterval(scrollTimer);
		scrollMover.style.left = "0px";
		scrollElem.innerHTML = scrollMover.innerHTML;
	}
	this.rewind = rewind;
	
	
	// Pause the scroll or resume it if paused already
	function pause()
	{
		if(scrollPlaying)
		{
			clearInterval(scrollTimer);
			scrollPlaying = false;
		}
		else
		{
			if(scrollPlayingDir == "left")	scrollTimer = setInterval(scrollLeft, scrollSpeed);
			if(scrollPlayingDir == "right")	scrollTimer = setInterval(scrollRight, scrollSpeed);
			scrollPlaying = true;
		}		
	}
	this.pause = pause;

}