


/* onmouseover of left arrow moves the scroll of the cars thumbnail pictures */
var leftTimout;
function moveLeft(){
	var thumbDiv = document.getElementById('thumbnailDiv');						// holds the whole thumbnails div
	var arrowL = document.getElementById('leftArrow');							// holds the left arrow image object
	var arrowR = document.getElementById('rightArrow');							// holds the right arrow image object
	if(thumbDiv.scrollLeft > 0){												// if ther's left scrolling remaining
		thumbDiv.scrollLeft -= 2;												// move the div scrolling
		leftTimout = window.setTimeout("moveLeft();", 1);						// loop
	}else{																		// if ther's no left scrolling remaining
		window.clearTimeout(leftTimout);										// stop loop
		arrowL.src = "/images/arrowPicL-dis.gif";								// change image to unavailable
		arrowL.style.cursor = "default";
	}
	if(thumbDiv.scrollWidth - thumbDiv.scrollLeft > 400){						// if scrolling to the right made availabe
		arrowR.src = "/images/arrowPicR.gif";									// change image to available
		arrowR.style.cursor = "hand";
	}
}

function moveLeftStop(){
	window.clearTimeout(leftTimout);											// stop div scrolling movement
}

/* onmouseover of right arrow moves the scroll of the cars thumbnail pictures */
var rightTimout;
function moveRight(){
	var thumbDiv = document.getElementById('thumbnailDiv');						// holds the whole thumbnails div
	var arrowL = document.getElementById('leftArrow');							// holds the left arrow image object
	var arrowR = document.getElementById('rightArrow');							// holds the right arrow image object
	if(thumbDiv.scrollWidth - thumbDiv.scrollLeft >= 485){						// if ther's right scrolling remaining
		thumbDiv.scrollLeft += 2;												// move the div scrolling
		rightTimout = window.setTimeout("moveRight();", 1);						// loop
	}else{																		// if ther's no right scrolling remaining
		window.clearTimeout(leftTimout);										// stop loop
		arrowR.src = "/images/arrowPicR-dis.gif";								// change image to unavailable
		arrowR.style.cursor = "default";
	}
	if(thumbDiv.scrollLeft > 10){												// if scrolling to the left made availabe
		arrowL.src = "/images/arrowPicL.gif";									// change image to available
		arrowL.style.cursor = "hand";
	}
}

function moveRightStop(){
	window.clearTimeout(rightTimout);											// stop div scrolling movement
}

/* fired from thumbnail click, displays the big version of the picture */
function shoPic(picSrc){
	document.getElementById('bigPicture').src = picSrc;
}
