var	scrollerWidth		=	0;
var	inactiveWidth		=	50;
var	activeWidth		=	0;
var	scrollerOffset		=	0;

var	contentItems		=	18;
var	contentItemWidth	=	108;
var	contentWidth		=	0;
var	contentScrollQuotient	=	1;

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

window.onload = function()
{

	var scroller		= document.getElementById( "scroller" );
	var scrollertext	= document.getElementById( "scrollertext" );

	scroller.onmousemove	= ScrollDiv;

	scrollerWidth		= scroller.offsetWidth;
	activeWidth		= scrollerWidth - 2 * inactiveWidth;
	contentItems		= scroller.childNodes.length - 2;
	contentWidth		= contentItems * contentItemWidth;
	contentScrollQuotient	= ( contentWidth - scrollerWidth ) / activeWidth;

	scrollerOffset = findPos( scroller )[0];

};

function ScrollDiv(event)
{

	var e = event || window.event;

	var PointerPosition = e.clientX - scrollerOffset;

	if ( PointerPosition < inactiveWidth )
	{
		PointerPosition = inactiveWidth;
	};
	if ( PointerPosition > scrollerWidth - inactiveWidth )
	{
		PointerPosition = scrollerWidth - inactiveWidth;
	};

	PointerPosition -= inactiveWidth;

	scroller.scrollLeft = PointerPosition * contentScrollQuotient;

};

function DisplayMovieTitle(text)
{

	scrollertext.innerHTML = text;

};
