// JavaScript Document
var timerUp = 0;
var timerDown = 0;
var scrollTop = 0; 
function toTop(id){ 
document.getElementById(id).scrollTop=0;
} 

var defaultStep = 5; 
var step = defaultStep;
function scrollDivDown(id){ 

	if(document.getElementById(id).offsetLeft <= -5){
		scrollTop+=step;
		document.getElementById(id).style.left = scrollTop + "px";
		timerDown=setTimeout("scrollDivDown('"+id+"')",10);
	}
} 

function scrollDivUp(id){

	 	if((document.getElementById(id).offsetWidth + document.getElementById(id).offsetLeft) > (document.getElementById("thumbnailSlideContainer").offsetWidth)){
				
		scrollTop -= step;
		document.getElementById(id).style.left = scrollTop + "px"; 
		
		timerUp=setTimeout("scrollDivUp('"+id+"')",10); 
	}	

} 

function scrollDivRight(id){
	if(document.getElementById(id).offsetLeft <= -5){
		scrollTop+=step;
		document.getElementById(id).style.left = scrollTop + "px";
		timerDown=setTimeout("scrollDivDown('"+id+"')",10);
	}
} 

function scrollDivLeft(id){
	 	if((document.getElementById(id).offsetWidth + document.getElementById(id).offsetLeft) > (document.getElementById("thumbnailSlideContainer").offsetWidth)){
		scrollTop -= step;
		document.getElementById(id).style.left = scrollTop + "px"; 
		timerUp=setTimeout("scrollDivUp('"+id+"')",10); 
	}	

} 

function toBottom(id){ 
document.getElementById(id).scrollTop=document.getElementById(id).scrollHeight; 
} 

function toPoint(id){ 
document.getElementById(id).scrollTop=100; 
} 

function changeMainPic(solution, picName){
	document.getElementById('imagePageWrapper').innerHTML = '<img src="' + currentDirectory + '/' + picName + '" alt="Furniture Solution ' + solution + '" />';
}