var stopScroll = 0;
var x;
var lastimg;
var direction = 1;
var boxHeight;
if(direction == 1) boxHeight = $('highlights').style.height.replace('px','');
else if(direction == 2) boxHeight = $('highlights').style.width.replace('px','');
var repeatHeight;
if(direction == 1) repeatHeight = $('highlights').scrollHeight; //get the current height so we know when to wrap
else if(direction == 2) repeatHeight = $('highlights').scrollWidth; //get the current height so we know when to wrap
$('highlights').innerHTML = $('highlights').innerHTML + $('highlights').innerHTML;  //add a second copy so we can scroll down to the wrap point
function scrollMe() {
	//alert("scroll");
	clearTimeout(x);
	if(!lastimg){
		lastimg = document.getElementById('onload'); 	
		x = setTimeout("scrollMe()", 500);
		return;
	}
	else if(!repeatHeight){
		if(direction == 1) repeatHeight = $('highlights').scrollHeight;
		else if(direction == 2) repeatHeight = $('highlights').scrollWidth;
		//alert(repeatHeight);
	}
	if(stopScroll==1) {
		return;
	}
	if(direction == 1) $('highlights').scrollTop=$('highlights').scrollTop+1;
	else if(direction == 2) $('highlights').scrollLeft=$('highlights').scrollLeft+1;
	if ($('highlights').scrollTop <= repeatHeight && direction == 1) {
		// keep on scrolin' 
		x = setTimeout("scrollMe()",40);
	}
	else if ($('highlights').scrollLeft <= repeatHeight && direction == 2) {
		// keep on scrolin' 
		x = setTimeout("scrollMe()",40);
	}	
	else { //we have hit the wrap point
		if(direction == 1) $('highlights').scrollTop = 0;
		else if(direction == 2) $('highlights').scrollLeft = 0;
		x = setTimeout("scrollMe()",40);
	}
}
x = setTimeout("scrollMe()",1000);