//per al scroll 2

function navegadorb(){
	if (ns4) {
		fletxa1b = document.flch1Divb;
		fletxa2b = document.flch2Divb;
		txtb = document.txtcontDivb.document.txtDivb;
		}
	if (ie4) {
		fletxa1b = flch1Divb.style;
		fletxa2b = flch2Divb.style;
		txtb = txtDivb.style;
		}		
	if (dom) {
		fletxa1b = document.getElementById("flch1Divb").style;
		fletxa2b = document.getElementById("flch2Divb").style;
		txtb = document.getElementById("txtDivb").style;
		
	}
	
	txtb.top = 0;
	txtb.yposb = parseInt(txtb.top);

}
// --- dectector de navegadors --- \\
if (parseInt(navigator.appVersion) >= 4) {
	if(navigator.appName == "Netscape") {
		if (navigator.appName.indexOf("MSIE 5")!=1&& parseInt(navigator.appVersion)>=5) {var dom=true;}
		else {var ns4=true;}
		}
	else {var ie4=true;}
}
// inici de la funcio roll()
var movingb=0

// mostrar o no les fletxes de l'scroll en funció de la llargada del text.
function fletxesb (largob) {
	
	if (ns4) {yyyb = txtb.clip.bottom;}
	if (ie4) {yyyb = document.all.txtDivb.scrollHeight;}
	if (dom) {yyyb = parseInt(document.getElementById("txtDivb").offsetHeight);}
	
	// yyy es llargada del text
	/* 'largo' es l'alçada del layer que conte text a partir de la qual volem que
	funcionin les fletxes, valor per defecte = alcada del layer*/
	if (yyyb > largob) {
	if (ns4) {fletxa1b.visibility = "show"; fletxa2b.visibility = "show";}
	if (ie4) {fletxa1b.visibility = "visible"; fletxa2b.visibility = "visible";}
	if (dom) {fletxa1b.visibility = "visible"; fletxa2b.visibility = "visible";}
	rollb(largob);
	}
	
	else {
		if (ns4) {fletxa1b.visibility = "hide"; fletxa2b.visibility = "hide";}
		if (ie4) {fletxa1b.visibility = "hidden"; fletxa2b.visibility = "hidden";}
		if (dom) {fletxa1b.visibility = "hidden"; fletxa2b.visibility = "hidden";}
		}
	window.focus();
	}

	
//moviment de l'scroll VERTICAL
function rollb(largob)
{ 
numb=largob;
  if (movingb==2)  {
   	if (yyyb>numb)  { 
		margesupb = (yyyb - numb)*(-1);
		if (txtb.yposb > margesupb) {
			txtb.yposb-=5;
			txtb.top = txtb.yposb;
			} 
	}
  }
 if (movingb==1)
    { 
     if (txtb.yposb<0) {
	 	txtb.yposb+=5;
		txtb.top = txtb.yposb;}
    }
 setTimeout("rollb(numb)",60)
}


