// *****************************************************************
// This drv file includes all of the functions for the top ticker
// Jeff Chew
// *****************************************************************

// scroller's speed
var scrollerspeed = 1;
var resumespeed = scrollerspeed;

// ticker width - this is the pixel setting where the ticker content resets to once it finishes scrolling to the left
var tickerWidth = 500;

// This starts out the ticker function, obtaining the width of the content to adjust the ticker accordingly
function startTicker(){
	divlayer = document.getElementById('slidingtext');
	textwidth = divlayer.offsetWidth;
	divlayer.style.left = tickerWidth + "px";
	slide();
}

// the function which moves the ticker content layer
function slide(){
	if (parseInt(divlayer.style.left) >= (textwidth * (-1))){
		divlayer.style.left = (parseInt(divlayer.style.left) - scrollerspeed) + "px";
		setTimeout("slide()",10);
	}else{
		divlayer.style.left = tickerWidth + "px";
		slide();
	}
}