// JavaScript Document

function Rsrolldiv(displaydiv,numItem,_itemWidth) {
	var videoboxlist = document.getElementById(displaydiv);	
	pos=_itemWidth*numItem;  
//	alert (pos);
	if (!pos) pos = videoboxlist.offsetWidth;
//	alert (videoboxlist.offsetWidth);
	var post = 0;
	var posm = Math.floor(pos/20);
	var timer = 1;
	while (post < pos) {                
		post += posm;
		window.setTimeout('ScrollItem("'+displaydiv+'",'+posm+')', timer);						
		if (timer < 50) timer = timer*2; else if (timer < 250) timer +=10; else  timer += 5; 
		if (posm > 25) posm -= 1; else if (posm > 10)posm = posm - Math.floor(posm/4); else posm = 1;
		
	}	
}

	function ScrollItem(displaydiv,posm){
		var videoboxlist = document.getElementById(displaydiv);	
		videoboxlist.scrollLeft +=posm;
	}
	
 function Lsrolldiv(displaydiv,numItem,_itemWidth) {
	pos=_itemWidth*numItem;  
	var videoboxlist = document.getElementById(displaydiv);	
	if (!pos)  pos = videoboxlist.offsetWidth;
	var post = 0;	
	var posm = Math.floor(pos/20);
	var timer = 1;	
	while (post < pos) {                
		post += posm;
		window.setTimeout('ScrollItem("'+displaydiv+'",-'+posm+')', timer);								
		if (timer < 50) timer = timer*2; else if (timer < 250) timer +=10; else  timer += 5; 
		if (posm > 25) posm -= 1; else if (posm > 10)posm = posm - Math.floor(posm/4); else posm = 1;				
	}	
}

function getElementYpos(el){
    var y = 0;
    while(el.offsetParent){
      y += el.offsetLeft;
      el = el.offsetParent;
    }
    return y;
  }

function  ScrollWin (displaydiv,numItem, _filmWidth){
	pos=_itemWidth*numItem;  
	var videoboxlist = document.getElementById(displaydiv);	
	videoboxlist.scrollLeft=pos;
}