tickerPosition = new Array();
tickerTimeouts = new Array();

function startTicker(sliceID, speed, init){
ticker = document.getElementById("tickerAnchor_"+sliceID);
//alert(ticker);

if(init){
tickerPosition['ticker_'+sliceID] = 0;

ticker.onmouseover = function(){ pauseTicker(sliceID); };
ticker.onmouseout = function(){ startTicker(sliceID, speed); };
}
var leftPos = parseInt(ticker.style.left.replace(/px/, ''));

//length of container
var boxObj = document.getElementById("tickerBox_"+sliceID);
var boxLength = parseInt(boxObj.offsetWidth.toString().replace(/px/, ''));
//length of content
var contentObj = document.getElementById("tickerContent_"+sliceID);
var contentLength = parseInt(contentObj.offsetWidth.toString().replace(/px/, ''));

if((leftPos * -1) > contentLength)
leftPos = boxLength + 5;

tickerPosition['ticker_'+sliceID] = (leftPos-5);
ticker.style.left = (leftPos-5)+"px";


tickerTimeouts['ticker_'+sliceID] = setTimeout(function(){ startTicker(sliceID, speed); }, (200 - (40 * (speed - 1))));
}

function pauseTicker(sliceID){
 clearTimeout(tickerTimeouts['ticker_'+sliceID]);
 tickerTimeouts['ticker_'+sliceID] = null;
} 


