<!--
/* scroll e tendina */
function verifyCompatibleBrowser(){ 
  this.ver=navigator.appVersion 
  this.dom=document.getElementById?1:0 
  this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
  this.ie4=(document.all && !this.dom)?1:0; 
  this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;  
  this.ns4=(document.layers && !this.dom)?1:0; 
  this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
  return this 
}
 
bw=new verifyCompatibleBrowser() 

var oggetto, oggetto2, contenutoOggetto, objScroller;

function ConstructObject(obj,nest){  
  nest=(!nest) ? '':'document.'+nest+'.';    
  this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
  this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;     
  /* per lo scroll */ 
  this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight;   
  this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight;
  this.up=MoveAreaUp;this.down=MoveAreaDown; 
    
  this.scrollWidth=bw.ns4?this.css.document.width:this.el.offsetWidth;
  this.clipWidth=bw.ns4?this.css.clip.width:this.el.offsetWidth;
  this.left=MoveAreaLeft;this.right=MoveAreaRight;
  this.MoveArea=MoveArea; this.x; this.y;
  /* fine per lo scroll */
  this.obj = obj + "Object"; 
  eval(this.obj + "=this");     
  return this; 
} 
/* tendina */
//cambiare qui la larghezza della finestra laterale e la velocità
var larghezzaBox, velocita, passo;
larghezzaBox = 570;
altezzaBox = 264;
velocita = 15;
pixel = larghezzaBox/40;
var speed=30; // per lo scroll
var loop, timer; // per lo scroll
var initialised;
 
function transizione(id, funzione, id2)
{		
	if (funzione=="apri") {
		oggetto=new ConstructObject(id);
		oggetto.css.display="inline";
		contenutoOggetto = new ConstructObject("contenuto"+id);
		animazione(0, larghezzaBox, pixel);
		if (id2!="nessuno") {
			oggetto2=new ConstructObject(id2);
			oggetto2.css.width=larghezzaBox;
			oggetto2.css.display="inline";
			window.setTimeout("secondaAnimazione("+larghezzaBox+", 0, -pixel)", 1000);
		}
	} else if (funzione=="chiudi") { 
		oggetto=new ConstructObject(id);
		oggetto.css.display="inline"; 
		animazione(larghezzaBox, 0, -pixel);
	}	else if (id2!="nessuno") {  //mantieni aperto l'ultimo se esiste
		oggetto2=new ConstructObject(id2);
		oggetto2.css.width=larghezzaBox;
		oggetto2.css.display="inline";
	}	
}

function animazione(i, j, passo) {	
	// controllare che il passo sia coerente
	oggetto.css.width=i;
	var max=(i>j)?i:j;
	i = i + passo;
	if ((i<=max) && (i>=0)) {
		window.setTimeout("animazione("+i+", "+j+", "+passo+")", velocita);
	} else if (i<0) {
		oggetto.css.display="none";
	} else {	
		contenutoOggetto.MoveArea(0, 0); //per lo scroll
		initialised=true; 
	}
}

function secondaAnimazione(i, j, passo) {	
	// controllare che il passo sia coerente
	oggetto2.css.width=i;
	var max=(i>j)?i:j;
	i = i + passo;
	if ((i<=max) && (i>=0)) {
		window.setTimeout("secondaAnimazione("+i+", "+j+", "+passo+")", velocita);
	} else if (i<0) {
		oggetto2.css.display="none";
	}
}

function doNothing() {	
	return;
}
/* scroll */
function MoveArea(x,y) { 
    this.x=x;
    this.y=y; 
    this.css.left=this.x;
    this.css.top=this.y;
    //valoreCoordinata=bw.dom?document.getElementById('valoreCoordinata'):bw.ie4?document.all['valoreCoordinata']:bw.ns4?eval('document.FormServizi.'+'document.'+'valoreCoordinata'):0; 
    //valoreCoordinata.value=this.x;    
} 

function MoveAreaLeft(move){	
	if (this.x<0) { 
		this.MoveArea(this.x-move, 0); 
		if (loop) {
			setTimeout(this.obj+".left("+move+")",speed); 
		}
	} 
}

function MoveAreaRight(move){	
	if (this.x>-this.scrollWidth+larghezzaBox-move) { //move per la tolleranza	
		this.MoveArea(this.x-move, 0); 
		if(loop) {
			setTimeout(this.obj+".right("+move+")",speed);
		} 
	} 
}

function PerformScroll(speed){ 
	if (initialised) { 
		loop=true; 
		if(speed>0) {
			contenutoOggetto.right(speed); 
		} else { 
			contenutoOggetto.left(speed);
		}
	} 
}

function MoveAreaDown(move){ 
	if (this.y>-this.scrollHeight+altezzaBox-move) { 
		this.MoveArea(0, this.y-move)
		valoreCoordinata=bw.dom?document.getElementById('valoreCoordinata'):bw.ie4?document.all['valoreCoordinata']:bw.ns4?eval('document.FormServizi.'+'document.'+'valoreCoordinata'):0; 
		valoreCoordinata.value=this.y; 
		if(loop) {
			setTimeout(this.obj+".down("+move+")",speed)
		}
	} 
}
 
function MoveAreaUp(move){ 
	if(this.y<0) { 
		this.MoveArea(0, this.y-move)
		valoreCoordinata=bw.dom?document.getElementById('valoreCoordinata'):bw.ie4?document.all['valoreCoordinata']:bw.ns4?eval('document.FormServizi.'+'document.'+'valoreCoordinata'):0; 
		valoreCoordinata.value=this.y; 
		if(loop) {
			setTimeout(this.obj+".up("+move+")",speed)
		}
	} 
}

function PerformScrollVerticale(speed){ 
	if(initialised) { 
		loop=true; 
		if(speed>0) {
			objScroller.down(speed) 
		} else {
			objScroller.up(speed) 
		}
	} 
} 
 
function CeaseScroll(){ 
    loop=false; 
    if (timer) {
			clearTimeout(timer); 
		}
} 

function InitialiseScrollableArea(idContent,inx,iny) {		
    //objContainer=new ConstructObject(idContainer); 
    objScroller=new ConstructObject(idContent);
    objScroller.MoveArea(inx,iny); 
    //objContainer.css.visibility='visible';    
    initialised=true; 		
    valoreCoordinata=bw.dom?document.getElementById('valoreCoordinata'):bw.ie4?document.all['valoreCoordinata']:bw.ns4?eval('document.FormServizi.'+'document.'+'valoreCoordinata'):0; 
		valoreCoordinata.value=objScroller.y;
}


//rollover
function preload_img()
{ 
  var img_list = preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length-1; i++) {
    document.preloadlist[top+i] = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}

function restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}

//]]>
-->
