// Script for panoramic picture displays.   Author: Ian E Currah, Oct. 2005

var running = 0
stopID = null

function init(){
	maxNum = Math.floor(document.images['panoholder'].width) - 638 //ie minus box width
	dirNum = 0; positn = 0; i = 1; num = 0; dirVal = -1
}

function startUp(){
	if(running != 0) return
	init()
	running = 1
	doLoop()
}

function doLoop(){
	stopID = setInterval("scrollWindow()", 10)
}
function scrollWindow(){
	document.getElementById('panoholder').style.position="relative"
	document.getElementById('panoholder').style.left = positn	
	positn = positn + dirVal
	//alert(dirVal + "   " + positn + "   " + maxNum)
	if(positn > -1 || positn < -maxNum) dirVal=dirVal * -1
}

function halt(){ 
	dirVal = 0
}

function direction(val){
	dirVal = val
}

function fast(fal){
	dirVal = fal * 3
}

function resetAll(){
	clearInterval(stopID)
	document.getElementById('panoholder').style.position="relative"
	document.getElementById('panoholder').style.left=1
	running = 0
	init()
}