/* col - interlated pty ltd */
speed=30
len=75
space="                                                                                                    ";
tid = 0;
c= -len;
waytogo = -1;
i = 0;
keepmoving = false;
var moves = 0;
var inc = -1;

function move() {
	moves++;
	for (i = 1; i < 5; i++) {
	  	var l = parseInt(document.images["shopFloorPic_" + i].style.left,10);
	  	l += inc;
	  	var s = l + 38;
	  	document.images["shopFloorPic_" + i].style.left = l + "px";
	  	document.images["spotlight" + i].style.left = s + "px";
		if (l < -190) {
			document.images["shopFloorPic_" + i].style.left = "600px";
			document.images["spotlight" + i].style.left = "638px";
		} else if (l > 600) {
			document.images["shopFloorPic_" + i].style.left = "-190px";
			document.images["spotlight" + i].style.left = "-152px";
		}
	}
//	inc = Math.round(inc *= .9);
	if (moves > 19) keepmoving = false;
	if (keepmoving) {	
		tid=window.setTimeout("move()",speed);
	}
}
  
function starttid() {
	inc = 1;
	tid=window.setTimeout("move()",speed);
}

function slideleft() {
	if (!keepmoving) {
		keepmoving = true;
		inc = -10;
		moves = 0;
		move();
	}
}

function slideright() {
	if (!keepmoving) {
		keepmoving = true;
		inc = 10;
		moves = 0;
		move();
	}
}

function cleartid() {
	window.clearTimeout(tid);
}

// just rollover for image
function showSpotlight(image) {
	var id = "spotlight" + image;
	var swapee = document.getElementById(id);
	if (swapee) {
		swapee.style.visibility = "visible";
	}
}

function hideSpotlight(image) {
	var id = "spotlight" + image;
	var swapee = document.getElementById(id);
	if (swapee) {
		swapee.style.visibility = "hidden";
	}
}

function hideAllSpots() {
	for (h = 1; h < 6; h++) {
		var id = "spotlight" + h;
		var swaper = document.getElementById(id);
		if (swaper) {
			swaper.style.visibility = "hidden";
		}
	}
}
