var browserType=navigator.userAgent.toLowerCase();
var isOkayToRun     = (((browserType.indexOf("msie") != -1) && (browserType.indexOf("opera") == -1)) && (browserType.indexOf("mac")!=-1));

var sec=2000;
var itm=1;
var timer="";
var itemArr = new Array;

function startScroller(){
	if(!isOkayToRun){
		oTable=document.getElementById("scrollertable"); 
		theBox=document.getElementById("scrollerdiv");
		width=oTable.offsetWidth;
		halfWidth=Math.floor(width/2);
		newWidth = (halfWidth*2)+2;
		theBox.style.width=258;//newWidth
		moveToRight(theBox, newWidth);
	}
}

function moveToRight(theBox, width){
	maxLeft = 0-width+20;
	//alert(maxLeft);
	theBox.style.left = ( parseInt(theBox.style.left) <= maxLeft )?0:parseInt(theBox.style.left)-1
	if(parseInt(theBox.style.left)==0)
		sec=2000;
	if(parseInt(theBox.style.left) == parseInt(itemArr[itm])*(-1)){
		pause = setTimeout("stop(theBox, "+width+");", 1);
		itm++;
	}
	else{
		timer = setTimeout ("moveToRight(theBox, "+width+");", sec);
	}
	sec = 20;
}

function stopScroller() {
	clearTimeout(timer); 
}

function stop(theBox, width){
	clearTimeout(pause);
	timer = setTimeout("moveToRight(theBox, "+width+");", 750);
}
