var px = 30;//mehr=schneller
var timerLeftRight;
var timerLeftRightBlog;

function scrollLeftRight(val, div) {
	if (div != 'thumbnailsBlog')	
		clearTimeout(timerLeftRight)
	else
		clearTimeout(timerLeftRightBlog);
	d = document.getElementById(div)
	x = d.scrollLeft;
	if(val==1) x -= px;
	if(val==2) x += px;
	if(x <= d.scrollWidth - d.offsetWidth + px && x >= 0 - px)
		{
		d.scrollLeft = x;
		if (div != 'thumbnailsBlog')
			timerLeftRight = setTimeout('scrollLeftRight('+val+',"thumbnails")', 50)
		else
			timerLeftRightBlog = setTimeout('scrollLeftRight('+val+',"thumbnailsBlog")', 50);
		}
		
	if(x < 0 || x > d.scrollWidth - d.offsetWidth)
		if (div != 'thumbnailsBlog')	
			clearTimeout(timerLeftRight)
		else
			clearTimeout(timerLeftRightBlog);

	if(d.scrollLeft > px) 
		if (div != 'thumbnailsBlog')	
			document.getElementById('arrow_l').style.visibility = "visible"
		else
			document.getElementById('arrow_l_Blog').style.visibility = "visible";
	else 
		if (div != 'thumbnailsBlog')	
			document.getElementById('arrow_l').style.visibility = "hidden"
		else 
			document.getElementById('arrow_l_Blog').style.visibility = "hidden";

	if(x > d.scrollWidth - d.offsetWidth) 
		if (div != 'thumbnailsBlog')	
			document.getElementById('arrow').style.visibility = "hidden"
		else
			document.getElementById('arrow_Blog').style.visibility = "hidden";
	else 
		if (div != 'thumbnailsBlog')	
			document.getElementById('arrow').style.visibility = "visible"
		else
			document.getElementById('arrow_Blog').style.visibility = "visible";
}
