var periodicalScroll = null;
var startingScroll = null;
var gallery;
var scrollable; 
var numfoto = 23;
window.onload = function() {
	gallery = document.getElementById('gallery');
	scrollable = document.getElementById('gallery-scrollable');
	scrollable.style.left = "0px";
	scrollable.style.width = (numfoto*150) + "px";
	/*
	document.getElementById('right-button').onmouseover = function() {ScrollRight(5)}
	document.getElementById('right-button').onmouseout = function() {ScrollStop()}
	document.getElementById('left-button').onmouseover = function() {ScrollLeft(5)}
	document.getElementById('left-button').onmouseout = function() {ScrollStop()}
	*/
	initLightbox();
	startingScroll = setTimeout("ScrollRight(1)",30);
}

function ScrollRight(speed){
	if (Math.abs(parseInt(scrollable.style.left)) < parseInt(scrollable.style.width)) {
		scrollable.style.left = parseInt(scrollable.style.left) - speed + "px";
		periodicalScroll = setTimeout("ScrollRight("+speed+")",30);
	} else {
		scrollable.style.left = "0px";
		periodicalScroll = setTimeout("ScrollRight("+speed+")",30);
	}
}


function ScrollLeft(speed){
	/*
	if (Math.abs(parseInt(scrollable.style.left)) > 0) {
		scrollable.style.left = parseInt(scrollable.style.left) + speed + "px";
		periodicalScroll = setTimeout("ScrollLeft("+speed+")",30);
	}	
	*/
}

function ScrollStop(){
  	/*
	clearTimeout(periodicalScroll);
	*/
}

