var listScroll;
var firstShow;
var itemsShow;
var scrollDelay;
var timer;
var pagevideotalent;
var videoThumbnail;
var nickname;
var number_view;

function videogalleryscroll(){
		leftScroll = document.getElementById('fotogleftscroll');
		rightScroll = document.getElementById('fotogrightscroll');
		if (leftScroll) {
			leftScroll.onmouseover = function () {scroll(-1);}
			leftScroll.onmouseout = function () {scroll(0);}
		}
		if (rightScroll) {
			rightScroll.onmouseover = function () {scroll(1);}
			rightScroll.onmouseout = function () {scroll(0);}
		}
		initScroll('videogalleryscroll', 'div', 8, 300);		
}

function initScroll(id_container, name_item, max_item, delay ){		
	listScroll = document.getElementById(id_container).getElementsByTagName(name_item);
		
	for (var i=0; i<max_item &&  i<listScroll.length; i++){
		listScroll[i].style.display = 'block';		
	}	
	itemsShow = max_item;
	firstShow = 0;
	scrollDelay = delay;
}	

function scroll(dir)
{		
	if ( dir==0 || (dir==1 && (firstShow + itemsShow)>= listScroll.length) || (dir==-1 && firstShow <= 0)) {
		clearTimer();				
		return;		
	}
		
	firstShow += dir;
	var lastShow =  firstShow + itemsShow;
			
	if (dir==1){
		listScroll[firstShow - 1].style.display = 'none';
		listScroll[lastShow - 1].style.display = 'block';
		setTimer('scroll(1)');
		return;		
	} 
	if (dir==-1){
		listScroll[firstShow].style.display = 'block';
		listScroll[lastShow].style.display = 'none';
		setTimer('scroll(-1)');
		return;		
	}		
}
	
function setTimer(fun){
	timer = setTimeout(fun, scrollDelay);
}

function clearTimer(){
	clearTimeout(timer);
}