var actiu=0;
var tope;
var topebaix;

function ini(){
	var width = screen.width; 
	var height = screen.height; 
	
	if(width<=1024){
		//document.getElementById('linia').style.top='175px';
		tope='175px';
		topebaix=440;
	}else{
		//document.getElementById('linia').style.top='225px';
		tope='225px';
		topebaix=490;
	}
}

function pujaScroll(scroll){
	h=document.getElementById(scroll).scrollHeight;
	document.getElementById(scroll).scrollTop=document.getElementById(scroll).scrollTop-10;
	/*
	if(parseInt(document.getElementById('linia').style.top)>parseInt(tope)){
		st=document.getElementById(scroll).scrollTop;		
		on=(st*275)/h;
		document.getElementById('linia').style.top=on+parseInt(tope);
	}
	*/
	if(actiu)
		setTimeout("pujaScroll('"+scroll+"')",50);
}

function baixaScroll(scroll){
	h=document.getElementById(scroll).scrollHeight;
	document.getElementById(scroll).scrollTop=document.getElementById(scroll).scrollTop+10;	
	/*
	if(parseInt(document.getElementById('linia').style.top)<topebaix && h>275){
		st=document.getElementById(scroll).scrollTop;		
		on=(st*275)/(h-275);
		document.getElementById('linia').style.top=on+parseInt(tope);
	
	}
	*/	
	if(actiu)
		setTimeout("baixaScroll('"+scroll+"')",50);
}

function migScroll(scroll){
	h=document.getElementById(scroll).scrollHeight;
	pos=(h*event.offsetY)/275;
	document.getElementById(scroll).scrollTop=pos;	
	//if(h>275) document.getElementById('linia').style.top=event.y;
}
