addthis_pub = 'Meo';
addthis_options = 'google, twitter, favorites, live, facebook, reddit, delicious, technorati, myspace, more';

var contentItemWidth = 182;
var inactiveWidth = 40;
var curLeftOffset = 0;
var scrolltextTimer = null;
var scrollertext;
var scroller;

function initScroller()
{
	scroller = document.getElementById("scroller");
	if (!scroller) return;
	scrollertext	= document.getElementById("scrollertext");

	imliveGreeting = scrollertext.innerHTML;
	scroller.onmousemove	= ScrollDiv;
	window.onresize = findPos;

	scrollerWidth		= scroller.offsetWidth;
	activeWidth		= scrollerWidth - 2 * inactiveWidth;
	contentItems		= scroller.getElementsByTagName('a').length;
	contentWidth		= contentItems * contentItemWidth;
	contentScrollQuotient	= ( contentWidth - scrollerWidth ) / activeWidth;

	findPos();

}

function findPos() {
	obj = scroller;
	if (obj.offsetParent) {
		curLeftOffset = obj.offsetLeft;
		while (obj = obj.offsetParent) {
			curLeftOffset += obj.offsetLeft;
		}
	}
}

function ScrollDiv(event)
{
	var e = event || window.event;
	var PointerPosition = e.clientX - curLeftOffset;
	popupPosX = e.clientX;
	popupPosY = e.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);

	if ( PointerPosition < inactiveWidth )
	{
		PointerPosition = inactiveWidth;
	};
	if ( PointerPosition > scrollerWidth - inactiveWidth )
	{
		PointerPosition = scrollerWidth - inactiveWidth;
	};

	PointerPosition -= inactiveWidth;
	scroller.scrollLeft = PointerPosition * contentScrollQuotient;
}

function dTitle(nick,isfree) {
	scr_text = 'Jerk off and blow your load with lovely <a href="http://www.her-dick.com/go/imlive-' + nick + '&promocode=BCODE_shgals';
	if (isfree == 1) scr_text = scr_text+ '&from=freevideo4';
	scr_text +=  '" target="_blank">' + nick + '</a> right now!';
	scrollertext.innerHTML = scr_text;
}
