
//<script>
function ViewMediumThumb(path, foto)
{
	var mediumthumblink = document.getElementById("mediumthumblink");
	var mediumthumb = document.getElementById("mediumthumb");
	
	mediumthumb.src = path+"/"+foto+"m.jpg";
	mediumthumblink.href = path+"/"+foto+"b.jpg";
}

function SweetMoveThumbs()
{
	var thumbs = document.getElementById("thumbs");
	
	var difference = thumbs.targetscrollTop - thumbs.scrollTop;
	var rate = Math.round(difference/5);
	thumbs.scrollTop += rate;
	
	if (rate == 0 || 
		(rate >= 0 && thumbs.scrollTop >= thumbs.targetscrollTop) ||
		(rate < 0 && thumbs.scrollTop <= thumbs.targetscrollTop))
	{
		thumbs.scrollTop = thumbs.targetscrollTop;
		clearInterval(thumbs.interval_id);
		thumbs.interval_id = 0;
	}
}

function MoveThumbs(direction)
{
	var thumbs = document.getElementById("thumbs");
	
	if (thumbs.interval_id)
	{
		thumbs.scrollTop = thumbs.targetscrollTop;
		clearInterval(thumbs.interval_id);
		thumbs.interval_id = 0;
	}
	else
	{
		var newscrolltop = 0;
		if (direction == "up")
			newscrolltop = thumbs.scrollTop - 65;
		else
			newscrolltop = thumbs.scrollTop + 65;
		
		if (newscrolltop + thumbs.clientHeight > thumbs.scrollHeight)
			return;
		
		if (newscrolltop == thumbs.scrollTop)
		{
			clearInterval(thumbs.interval_id);
			thumbs.interval_id = 0;
			return;
		}
		
		thumbs.targetscrollTop = newscrolltop;
		clearInterval(thumbs.interval_id);
		thumbs.interval_id = setInterval(SweetMoveThumbs, 50);
	}
}