

var speed = 50;
var scrollAmount = 1;
var thumbWidth = 85;
var thumbsPerPane = 9;


// Array of all the panes that are to be scrolled
var panes = new Array()

// Definition of the Pane object
function Pane(name, width, left){
	this.name = name;
	this.width = width;
	this.left = left;
}

// Establish the panes
panes[0] = new Pane('scrollPane', (thumbWidth * thumbsPerPane), 0)
panes[1] = new Pane('scrollPane2', (thumbWidth * thumbsPerPane), (thumbWidth * thumbsPerPane))




var numPanes = panes.length;
var ii
var hhh
var nnn
var myInterval
var myPause
var mode = 0


var imgArray = new Array(numPanes)
var myLeft = new Array(numPanes)

for (ii=0;ii<numPanes;ii++){

	hhh=0
	for (nnn=0;nnn<ii;nnn++){
		hhh=hhh+panes[nnn].width
	}
	myLeft[ii] = hhh
}

function ready(){
	for (ii=0;ii<numPanes;ii++){
		if (document.images[ii].complete == false){
			return false
			break
		}
	}
return true
}


function startScrolling(){
	if (ready() == true){
		window.clearInterval(myPause)
		myInterval = setInterval("autoScroll()",speed)
	}
}


function autoScroll(){
	
	for(var i=0; i<numPanes; i++) {
		var tmpPane = panes[i];
		
		var myObj = document.getElementById(tmpPane.name);
		
		if(myObj != null) {
			tmpPane.left = tmpPane.left - scrollAmount;
				
			
			if (tmpPane.left == -tmpPane.width){
				tmpPane.left = tmpPane.width;
			}
			
			myObj.style.left = tmpPane.left + "px";
		}
		
	}
	
	mode = 1
}

function stop(){
	if (mode == 1){
		window.clearInterval(myInterval)
	}
	if (mode == 0){
		window.clearInterval(myPause)
	}
}

function go(){
	if (mode == 1){
		myInterval = setInterval("autoScroll()",speed)
	}
	if (mode == 0){
		myPause = setInterval("startScrolling()",1000)
	}
}

myPause = setInterval("startScrolling()",1000)

