var clipwidth = 563;
var scrollerspeed=6; // (larger is faster 1-10)
var pauseit=1;
var copyspeed=scrollerspeed;
var actualwidth='';
var pausespeed=(pauseit==0)? copyspeed: 0;

function initialiseScroller(){
	var rightScroller = document.getElementById("rightArrow");
	if (rightScroller) {
		rightScroller.onmouseover = function() {
			lefttime2 = setInterval('scrollRight()',20);
		}
		rightScroller.onmouseout = function() {
			clearTimeout(lefttime2);
		}
	}
	
	var leftScroller = document.getElementById("leftArrow");
	if (leftScroller) {
		leftScroller.onmouseover = function() {
			lefttime=setInterval('scrollLeft()',20);
		}
		leftScroller.onmouseout = function() {
			clearTimeout(lefttime);
		}
	}

	var scroller=document.getElementById("thumbs");
	if(scroller) {
		if(initial_scroll > 0) {
			scroller.style.left=-initial_scroll+"px";
		}else{
			scroller.style.left="9px";
		}
		actualwidth=scroller.offsetWidth;
	}
}
function scrollRight(){
	var scroller=document.getElementById("thumbs");		
	if(scroller) {	
		if (parseInt(scroller.style.left)>(actualwidth*(-1)+clipwidth)) {
			scroller.style.left=parseInt(scroller.style.left)-copyspeed+"px";
		}
	}
}
function scrollLeft(){
	var scroller=document.getElementById("thumbs");
	if(scroller) {
		if (parseInt(scroller.style.left)<6) {
			scroller.style.left=parseInt(scroller.style.left)+copyspeed+"px";
		}
	}
}

addLoadEvent(initialiseScroller);

