/*function scrollImg(whichDir){
	x = document.getElementById('scrollStrip');
	var scrstrLeft = x.offsetLeft;
	flag = (whichDir=='left' ? scrstrLeft-77 : scrstrLeft+77);
	
	x.style.left = flag + 'px';
}*/


function scrollImg(dirFlag){
	var cellArray = document.getElementById('scrollTab').getElementsByTagName('td');
	var firstCell = cellArray[0];
	var lastCell = cellArray[cellArray.length-1];			
	
	if(dirFlag =='left'){
	
		// remove the cell and store it in the variable oldCell			
		var oldCell = firstCell.parentNode.removeChild(firstCell);
			
		var theTab = document.getElementById('scrollTab');
		var theTabRow = theTab.getElementsByTagName( "TR" ).item(0);
		
		//place oldCell at end of the table
		theTabRow.appendChild( oldCell );
		
	}else if(dirFlag == 'right'){
	
		var oldCell = lastCell.parentNode.removeChild(lastCell);
		
		var theTab = document.getElementById('scrollTab');
		var theTabRow = theTab.getElementsByTagName( "TR" ).item(0);
		
		theTabRow.insertBefore(oldCell, firstCell);
	}
}

var scrollerInterval;
function startScroll(dirFlag) {
	stopScroll();
	scrollImg(dirFlag);
	scrollerInterval = setInterval( "scrollImg('" + dirFlag + "')", 250 );
}
function stopScroll() {
	clearInterval( scrollerInterval );
}

//init en timeouts:
var t
t=0;
function timedCount() {
  startScroll('left')
  stopScroll()
  t = setTimeout("timedCount()",3000)
}

window.onload = function() {timedCount();}

