<!--

var fermascorrimento=1;

function visibilita_barra(n,v) {
	document.getElementById("su"+n).style.visibility=v;
	document.getElementById("barrasu"+n).style.visibility=v;
	document.getElementById("barra"+n).style.visibility=v;
	document.getElementById("barragiu"+n).style.visibility=v;
	document.getElementById("giu"+n).style.visibility=v;
	document.getElementById("indicatorebarra"+n).style.visibility=v;
}

function creabarra(n,x,y,lunghezza,v) {
  if (!document.all) {
	  document.write('<IMG id="su'+n+'" style="TOP: '+y+'px; LEFT: '+x+'px; HEIGHT: 18px; WIDTH: 20px; CURSOR: pointer; POSITION: absolute; VISIBILITY: '+v+';" alt="" src="images/tastosu.bmp" name="su'+n+'" onmouseover="su_onmouseover('+n+')" onmouseout="su_onmouseout('+n+');">\n');
	  document.write('<IMG id="barrasu'+n+'" style="TOP: '+(y+18)+'px; LEFT: '+x+'px; HEIGHT: 10px; WIDTH: 20px; CURSOR: pointer; POSITION: absolute; VISIBILITY: '+v+';" alt="" src="images/barrasu.bmp">\n');
	  document.write('<IMG id="barra'+n+'" style="TOP: '+(y+18+10)+'px; LEFT: '+x+'px; HEIGHT: '+(lunghezza-28*2)+'px; WIDTH: 20px; POSITION: absolute; VISIBILITY: '+v+';" alt="" src="images/barra.bmp" name="barra'+n+'">\n');
	  document.write('<IMG id="barragiu'+n+'" style="TOP: '+(y+lunghezza-28)+'px; LEFT: '+x+'px; HEIGHT: 10px; WIDTH: 20px; CURSOR: pointer; POSITION: absolute; VISIBILITY: '+v+';" alt="" src="images/barragiu.bmp" >\n');
	  document.write('<IMG id="giu'+n+'" style="TOP: '+(y+lunghezza-18)+'px; LEFT: '+x+'px; HEIGHT: 18px; WIDTH: 20px; CURSOR: pointer; POSITION: absolute; VISIBILITY: '+v+';" alt="" src="images/tastogiu.bmp" name="giu'+n+'" onmouseover="giu_onmouseover('+n+')" onmouseout="giu_onmouseout('+n+');">\n');
	  document.write('<div id="indicatorebarra'+n+'" style="TOP: '+(y+10+16-6)+'px; LEFT: '+x+'px; HEIGHT: 15px; WIDTH: 20px; POSITION: absolute; BACKGROUND-COLOR: transparent; VISIBILITY: '+v+';" onmove="alert('+n+')"><IMG id="imgindicatorebarra'+n+'" style="CURSOR: pointer" alt="" src="images/cursore.bmp"></div>\n');
    document.write('<SCRIPT language="JavaScript" type="text/javascript">');
    //document.write('document.addEventListener("onmove", scorrimento'+n+'(), false);');
    document.write('</SCRIPT>');
    
  } else {
	  document.write('<IMG id="su'+n+'" style="TOP: '+y+'px; LEFT: '+x+'px; HEIGHT: 18px; WIDTH: 20px; CURSOR: pointer; POSITION: absolute; VISIBILITY: '+v+';" alt="" src="images/tastosu.bmp" name="su'+n+'" onmouseover="su_onmouseover('+n+')" onmouseout="su_onmouseout('+n+')">\n');
	  document.write('<IMG id="barrasu'+n+'" style="TOP: '+(y+18)+'px; LEFT: '+x+'px; HEIGHT: 10px; WIDTH: 20px; CURSOR: pointer; POSITION: absolute; VISIBILITY: '+v+';" alt="" src="images/barrasu.bmp">\n');
	  document.write('<IMG id="barra'+n+'" style="TOP: '+(y+18+10)+'px; LEFT: '+x+'px; HEIGHT: '+(lunghezza-28*2)+'px; WIDTH: 20px; POSITION: absolute; VISIBILITY: '+v+';" alt="" src="images/barra.bmp" name="barra'+n+'">\n');
	  document.write('<IMG id="barragiu'+n+'" style="TOP: '+(y+lunghezza-28)+'px; LEFT: '+x+'px; HEIGHT: 10px; WIDTH: 20px; CURSOR: pointer; POSITION: absolute; VISIBILITY: '+v+';" alt="" src="images/barragiu.bmp" >\n');
	  document.write('<IMG id="giu'+n+'" style="TOP: '+(y+lunghezza-18)+'px; LEFT: '+x+'px; HEIGHT: 18px; WIDTH: 20px; CURSOR: pointer; POSITION: absolute; VISIBILITY: '+v+';" alt="" src="images/tastogiu.bmp" name="giu'+n+'" onmouseover="giu_onmouseover('+n+')" onmouseout="giu_onmouseout('+n+')">\n');
	  document.write('<div id="indicatorebarra'+n+'" style="TOP: '+(y+10+16-6)+'px; LEFT: '+x+'px; HEIGHT: 15px; WIDTH: 20px; POSITION: absolute; BACKGROUND-COLOR: transparent; VISIBILITY: '+v+';" onmove="scorrimento'+n+'()"><IMG id="imgindicatorebarra'+n+'" style="CURSOR: pointer" alt="" src="images/cursore.bmp"></div>\n');
  }
	document.getElementById("indicatorebarra"+n).style.top=(parseInt(document.getElementById("barra"+n).style.top)-6).toString()+"px";
  if (!document.all) {
    document.addEventListener("mousedown", indicatorebarra_down, false);
    document.addEventListener("mouseup", indicatorebarra_up, false);
    document.addEventListener("mousedrag", indicatorebarra_drag, false); } 
    //document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP); 
  else {
  document.onmousedown = indicatorebarra_down;
  document.onmousemove = indicatorebarra_drag;
  document.onmouseup = indicatorebarra_up;
  }
}

function giu_onmouseover(n) {
	fermascorrimento=0;
	scorrimentotesto(1,n);
}

function giu_onmouseout(n) {
		fermascorrimento=1;
}

function su_onmouseover(n) {
	fermascorrimento=0;
	scorrimentotesto(-1,n);
}

function su_onmouseout(n) {
		fermascorrimento=1;
}

function scorrimentotesto(direzione,n) {
var CURSORE=document.getElementById("indicatorebarra"+n.toString());
	if (fermascorrimento==0) {
		if (((direzione==1) && (parseInt(CURSORE.style.top)<parseInt(document.getElementById("barra"+n.toString()).style.top)+parseInt(document.getElementById("barra"+n.toString()).style.height)+6-parseInt(CURSORE.style.height))) || ((direzione==-1) && (parseInt(CURSORE.style.top)>parseInt(document.getElementById("barra"+n.toString()).style.top)-6))) {
			CURSORE.style.top=(parseInt(CURSORE.style.top)+direzione).toString()+"px";
			setTimeout("scorrimentotesto("+direzione.toString()+","+n.toString()+")",10);
		}
	}
}





var selectedObj;
var offsetY;
var numero_barra_attiva;

function indicatorebarra_down(evt) {
  cattura_indicatorebarra(evt);
  if (selectedObj) {
    if (!document.all) 
      offsetY = evt.pageY - selectedObj.top;
    else 
      offsetY = window.event.offsetY;
  }
  return false;
}

function indicatorebarra_up(evt) {
  if (selectedObj) {
    selectedObj.zIndex=0;
    selectedObj=null;
  }
}

function indicatorebarra_drag(evt) {
  if (selectedObj) {
    var n=numero_barra_attiva;
    if (window.event.clientY+document.documentElement.scrollTop - offsetY<parseInt(document.getElementById("barra"+n).style.top)-6) 
      selectedObj.pixelTop=parseInt(document.getElementById("barra"+n).style.top)-6;
    else
      if (window.event.clientY+document.documentElement.scrollTop - offsetY>parseInt(document.getElementById("barra"+n).style.top)+parseInt(document.getElementById("barra"+n).style.height)+6-parseInt(selectedObj.height)) 
        selectedObj.pixelTop=parseInt(document.getElementById("barra"+n).style.top)+parseInt(document.getElementById("barra"+n).style.height)+6-parseInt(selectedObj.height);      
      else
        selectedObj.pixelTop=window.event.clientY+document.documentElement.scrollTop - offsetY;
    return false; 
  }
}

function cattura_indicatorebarra(evt) {
  if (!document.all) {
//    var testObj;
//    var clickX = evt.pageX;
//    var clickY = evt.pageY;
//    for (var i = document.layers.length - 1; i >= 0; i--) {
//      testObj = document.layers[i];
//      if ((clickX > testObj.left) && (clickX < testObj.left + testObj.clip.width) && (clickY > testObj.top) && (clickY < testObj.top + testObj.clip.height) && (testObj.name=="indicatorebarra1")) {
//        selectedObj = testObj;
//        selectedObj.zIndex=100;
//        return;
//      }
//    }
  }
  else {
    var imgObj = window.event.srcElement;
    if (imgObj.id.indexOf("imgindicatorebarra") != -1) {
      numero_barra_attiva=imgObj.parentElement.id.substr(15);
      selectedObj=imgObj.parentElement.style;
      selectedObj.zIndex=100;
      return; }
  }
  selectedObj = null;
  return;
}





//*******************************************************************************************************************
//function giu_onmouseover() {
//	fermascorrimento=0;
//	scorrimentotesto(-1);
//}

//function giu_onmouseout() {
//	if (parseInt(descrtxt.document.getElementById("DIVTXT").style.top)+descrtxt.document.getElementById("DIVTXT").scrollHeight>(parseInt(document.getElementById("descrtxt").style.height))) {
//		fermascorrimento=10;
//	}
//	scorrimentotesto(-1);
//}

//function su_onmouseover() {
//	fermascorrimento=0;
//	scorrimentotesto(1);
//}

//function su_onmouseout() {
//	if (parseInt(descrtxt.document.getElementById("DIVTXT").style.top)<0) {
//		fermascorrimento=10;
//	}
//	scorrimentotesto(1);
//}

//function scorrimentotesto(direzione) {
//var O_DIVTXT=descrtxt.document.getElementById("DIVTXT");
//	if (fermascorrimento==0) {
//		if (((direzione==-1) && (parseInt(O_DIVTXT.style.top)+O_DIVTXT.scrollHeight>parseInt(document.getElementById("descrtxt").style.height))) || ((direzione==1) && (parseInt(O_DIVTXT.style.top)<0))) {
//			O_DIVTXT.style.top=(parseInt(O_DIVTXT.style.top)+direzione).toString()+"px";
//			setTimeout("scorrimentotesto("+direzione.toString()+")",10);
//		}
//	}
//	if (fermascorrimento>1) {
//		if (((direzione==1) && (parseInt(O_DIVTXT.style.top)+O_DIVTXT.scrollHeight>parseInt(document.getElementById("descrtxt").style.height))) || ((direzione==-1) && (parseInt(O_DIVTXT.style.top)<0))) {
//			O_DIVTXT.style.top=(parseInt(O_DIVTXT.style.top)-direzione).toString()+"px";
//			fermascorrimento=fermascorrimento-1;
//			setTimeout("scorrimentotesto("+direzione.toString()+")",40);
//		}
//	}
//	document.getElementById("indicatorebarra").style.top=((-parseInt(O_DIVTXT.style.top)/(O_DIVTXT.scrollHeight-parseInt(document.getElementById("descrtxt").style.height)))*(parseInt(document.getElementById("barra").style.height)+12-parseInt(document.getElementById("indicatorebarra").style.height))+parseInt(document.getElementById("barrasu").style.top)+4).toString()+"px";
//}






//var selectedObj;
//var offsetX, offsetY;


//function indicatorebarra_down(evt) {
//  cattura_indicatorebarra(evt);
//  if (selectedObj) {
//    offsetX = window.event.offsetX;
//    offsetY = window.event.offsetY;
//  }
//  return false;
//}

//function indicatorebarra_up(evt) {
//  if (selectedObj) {
//    selectedObj.zIndex=0;
//    selectedObj=null;
//  }
//}

//function indicatorebarra_drag(evt) {
//  if (selectedObj) {
//    selectedObj.pixelTop=window.event.clientY - offsetY;
//    return false
//  }
//}

//function cattura_indicatorebarra(evt) {
//var imgObj = window.event.srcElement;
//  if (imgObj.parentElement.id.indexOf("indicatorebarra") != -1) {
//    selectedObj=imgObj.parentElement.style;
//    selectedObj.zIndex=100;
//    return; }
//  selectedObj = null;
//  return;
//}
//****************************************************************************************
































//var isNav, isIE




//var offsetX, offsetY
//var selectedObj 

//var posbarre_x = 50
//var posbarre_y = 160

//var poscurseur_x = posbarre_x+20

//var scalaleft = posbarre_x+20
//var scalaright = posbarre_x+260

//var scalawidth =scalaright-scalaleft

//var poscurseur_y = posbarre_y

//if (parseInt(navigator.appVersion) >= 4) {
//        if (navigator.appName == "Netscape") {
//                isNav = true
//        } else {
//                isIE = true
//        }
//}

//function setZIndex(obj, zOrder) {
//        obj.zIndex = zOrder
//}

//function shiftTo(obj, x, y) {
//// Control of over-scrolling
//if (x<=scalaleft) {x=scalaleft}
//if (x>=scalaright) {x=scalaright}
//        
//if (isNav)
//  {
//    // Scrolling code for Navigator
//    obj.moveTo(x,poscurseur_y)
//    document.layers["contenu"].left = 2*(posbarre_x)-x+20;
//    document.layers["contenu"].clip.right = 293 +x-posbarre_x-20;
//    document.layers["contenu"].clip.left =-posbarre_x+x-20;
//    document.close()
//  }
//    else
//  { 
//    // Scrolling code for Internet Explorer
//    obj.pixelLeft = x;
//    obj.pixelTop = poscurseur_y
//    document.all["contenu"].style.left = 2*(posbarre_x)-x+20;

//    // Order of rect coordinates: top right bottom left
//    ev = 'rect(0px '+eval(293+x-posbarre_x-20)+'px 100px' +eval(posbarre_x-x+19.9)+'px'+')';
//    document.all["contenu"].style.clip = ev;
//  }        
//}

//function setSelectedElem(evt) {
//        if (isNav) {
//                var testObj
//                var clickX = evt.pageX
//                var clickY = evt.pageY
//                for (var i = document.layers.length - 1; i >= 0; i--) {
//                        testObj = document.layers[i]
//                        if ((clickX > testObj.left) && 
//                                (clickX < testObj.left + testObj.clip.width) && 
//                                (clickY > testObj.top) && 
//                                (clickY < testObj.top + testObj.clip.height) && (testObj.name=="curseur")) {
//                                        selectedObj = testObj
//                                        setZIndex(selectedObj, 100)
//                                        return
//                        }
//                }
//        } else {
//                var imgObj = window.event.srcElement
//                if (imgObj.parentElement.id.indexOf("curseur") != -1) {
//                        selectedObj = imgObj.parentElement.style
//                        setZIndex(selectedObj,100)
//                        return
//                }
//        }
//        selectedObj = null
//        return
//}

//function dragIt(evt) {
//        if (selectedObj) {
//                if (isNav) {
//                        shiftTo(selectedObj, (evt.pageX - offsetX), (evt.pageY - offsetY))
//                } else {
//                        shiftTo(selectedObj, (window.event.clientX - offsetX), (window.event.clientY - offsetY))
//                        return false
//                }
//        }
//}

//function engage(evt) {
//        setSelectedElem(evt)
//        if (selectedObj) {
//                if (isNav) {
//                        offsetX = evt.pageX - selectedObj.left
//                        offsetY = evt.pageY - selectedObj.top
//                } else {
//                        offsetX = window.event.offsetX
//                        offsetY = window.event.offsetY
//                }
//        }
//        return false
//}

//function release(evt) {
//        if (selectedObj) {
//                setZIndex(selectedObj, 0)
//                selectedObj = null
//        }
//}

//function setNavEventCapture() {
//        if (isNav) {
//                document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP)
//        }
//}

//function init() {
//        if (isNav) {
//                document.barre.left=posbarre_x
//                document.barre.top=posbarre_y
//                
//                document.curseur.left=poscurseur_x
//                document.curseur.top=poscurseur_y
//                
//                setNavEventCapture()
//        }       
//        if (isIE) {
//                document.all.barre.style.posLeft=posbarre_x
//                document.all.barre.style.posTop=posbarre_y
//                
//                document.all.curseur.style.posLeft=poscurseur_x
//                document.all.curseur.style.posTop=poscurseur_y
//        }

//        document.onmousedown = engage
//        document.onmousemove = dragIt
//        document.onmouseup = release
//}
-->
