

/////////////// ACTION SCROLLER ///////////////

function initActionScroll() {
	// copy the actions
	actionsCopy = document.createElement('DIV');
	actionsCopy.id = 'actions2';
	actionsCopy.innerHTML = document.getElementById('actions').innerHTML;
	actionsCopy.style.left = (getElementWidth('actions')) + 'px';
	insertAfter((actionsCopy),document.getElementById('actions'));
	actionsWidth = getElementWidth('actions');
	actionsLeft = -1*(Math.floor(Math.random()*actionsWidth));
	document.getElementById('actions').style.left = actionsLeft+'px';
	actions2Left = actionsLeft + actionsWidth;
	setInterval("actionScroll();",35);
	document.getElementById('actionContainer').onmouseover = function() {
		haltScroll = true;
	}
	document.getElementById('actionContainer').onmouseout = function() {
		haltScroll = false;
	}
}

haltScroll = false;
function actionScroll() {
	if (!haltScroll) {
		a1 = document.getElementById('actions');
		a2 = document.getElementById('actions2');
		actionsLeft--;
		if ((actionsLeft + actionsWidth) == 0) actionsLeft += actionsWidth*2;
		a1.style.left = actionsLeft+'px';
		actions2Left--;
		if ((actions2Left + actionsWidth) == 0) actions2Left += actionsWidth*2;
		a2.style.left = actions2Left+'px';
	}
}

function getElementWidth(elId) {
	d = document.getElementById(elId);
	if (d.offsetWidth) { 
		divWidth=d.offsetWidth; 					
	} else if(d.style.pixelWidth) { 
		divWidth=d.style.pixelWidth;					 
	} 
	return(divWidth);
}

function insertAfter(newChild, refChild) { 
 refChild.parentNode.insertBefore(newChild,refChild.nextSibling); 
}

loadMeUp += "initActionScroll();";



