var t;
var scroll_in_progress;
var pos=0;

function start_scroll(direction){
	if (scroll_in_progress!=1) {
		srcoll_in_progress=1;

		scroll(direction);
	}
}

function scroll(direction)
//direction: left=0, right=1;
{
	w=document.getElementById('galeria_scroll_container');
	v=document.getElementById('galeria_scroll_content');
	if (direction==1){
		if (v.firstChild.clientWidth+pos>w.clientWidth){
			pos-=8;
			v.style.left=pos;
		}
	}
	else {
		if (pos<0){
			pos+=8;
			v.style.left=pos;
		}
	}
	t=setTimeout("scroll("+direction+")",40);
}

function stop_scroll(){
	clearTimeout(t);
	scroll_in_progress=0;
}

function updateMainImage(p_this, p_url){
	i=document.getElementById('galeria_mainimage');
	i.src=p_url;

}
