
function setWWidth()
 {
 with (document.getElementsByTagName('img')[0]) // (document.izoom)
  {
   var w = width+200;
   var h = height+200;
   if (h > screen.height-120) h = screen.height-120;
   if (w > screen.width-100) w = screen.width-100;    
   window.resizeTo(w, h);
//alert('w =' + w +'\n h=' + h +'\n screen-w =' + screen.width + '\n screen-h = '+ screen.height);
  } 

 }  

function changeLang( l ) {
	var url = window.location.href;
	if( url.indexOf( "?" ) >=0 ) {
		var idx = url.indexOf( "&setLang=" );
		if( idx>=0 ) {
			url = url.substring( 0, idx );
		}
		url += "&setLang="+l;
	}
	else {
		url += "?setLang="+l;
	}
	window.location.href=url;
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function WOFocusWin( name ) {
	
	eval( "if( this."+name+") this."+name+".moveTo(50,50); this."+name+".focus();" );
	
}

function WOOpenWin( name, url, ctrl ) {
	eval( "this."+name+"=window.open('"+url+"','"+name+"','"+ctrl+"');" );
	window.setTimeout( "top.winOpener.focusWin('"+name+"');", 300 );
}

function WinOpener() {
	this.openWin=WOOpenWin;
	this.focusWin=WOFocusWin;
}
top.winOpener=new WinOpener();

function openPopUp( v1, v2, v3 ) {
	top.winOpener.openWin( v1, v2, v3 );	
}

function popup_term( id ) {
	top.winOpener.openWin( "glossario", "gloss.jsp?id="+id, "resizable=yes,scrollbars=yes,width=580,height=450" );
}

function popup_image( id ) {
	top.winOpener.openWin( "immagine", "image.jsp?id="+id, "resizable=yes,scrollbars=yes,width=580,height=550" );
}





		var TBX_onstyle="background-color:#ff0000;";
		var TBX_offstyle="background-color:#ffffff;";
	
		function TBX_init() {
			// browse the document and find all TBX_* tags
			TBX_browse( document.documentElement );
		}
		
		TBX_all=null;
		
		
		function TBX_handler( btn, id, tab ) {
			TBX_all[id]=this;
			this.id = id;
			this.tab=tab;
			this.btn=btn;
			this.handleClick=TBX_handleClick;
			btn.onclick=this.handleClick;
			this.show=TBX_show;
			this.hide=TBX_hide;
		}

		TBX_current=null;
		
		function TBX_show() {
			this.tab.style.display="block";
			if( TBX_current ) TBX_current.hide();
			TBX_current=this;
			var cn = this.btn.className;
			if( !cn ) cn = "";
			else cn=cn.replace( "TBX_inactive" );
			cn+=" TBX_active";
			cn=cn.replace( "  ", " " );
			this.btn.className=cn;
		}
		
		function TBX_hide() {
			this.tab.style.display="none";
			var cn = this.btn.className;
			if( !cn ) cn = "";
			else cn=cn.replace( "TBX_active" );
			cn+=" TBX_inactive";
			cn=cn.replace( "  ", " " );
			this.btn.className=cn;
		}

		function TBX_handleClick() {
			var th=TBX_all[this.id];
			if( th == TBX_current ) return;
			th.show();
		}
		
		function TBX_browse( n ) {
			var id = n.id;
			var idx = -1;
			if( id!=null ) idx=id.indexOf( "TBX_" );
			if( id != null && idx==0 && id.substring(5,id.length).indexOf( "_" )<0 ) {
				var tab = document.getElementById( id+"_tab" );
				if( tab ) {
					if( TBX_all == null ) {
						// initialize the TBX_all and keep this  tab visible
						TBX_all=new Array();
						var th = new TBX_handler( n, id, tab );
						th.show();
					}
					else {
						var th = new TBX_handler( n, id, tab );
						th.hide();						
					}
				}
			}
			for( var i = 0; i<n.childNodes.length; i++ ) {
				if( n.nodeType == 1 ) 
					TBX_browse( n.childNodes[i] );
			}
		}


/* Menu */
		
	function MB_init() {			
			MB_browse( document.documentElement );
		}
		
		var MB_current = null;
		var MB_count = 0;
		var MB_els = new Array();
		var MB_left=50;
		var MB_space = 110;
		var MB_delay = 300;
		
		function MB_Menu( el ) {
			el.style.display="block";
			el.btn = MB_findChildByName( el, "H3" );
			el.btn.style.position="absolute";
			el.btn.className="MB_btn";
			el.box = MB_findChildByName( el, "UL" );
			if( el.box) {
				el.box.position="absolute";
				el.box.className="MB_box";
				el.box.el=el;
				el.box.style.left = ""+(MB_left+MB_count*MB_space)+"px";
				el.box.onmouseover=MB_BoxOver;
				el.box.onmouseout=MB_BoxOut;
				el.box.style.display="none";
			}
			el.btn.el=el;
			el.btn.style.left = ""+(MB_left+MB_count*MB_space)+"px";
			el.btn.onmouseover=MB_BtnOver;
			el.btn.onmouseout=MB_BtnOut;
			MB_els[el]=false;
			MB_count++;
		}
		
		
		function MB_BoxOver(){
			MB_els[this.el]=true;			
		}
		
		function MB_BtnOut() {
			MB_els[this.el]=false;
			window.setTimeout( "MB_reallyHide()", MB_delay );
		}		
		
		function MB_BtnOver() {
			//if( MB_current==this.el ) return;
			if( MB_current ) {
				MB_current.box.style.display="none";
				MB_current.btn.className="MB_btn";
				MB_current = null;
			}
			if( this.el.box ) {
				this.el.box.style.display="block";
				this.className="MB_btn_over"
				MB_current=this.el;
				MB_els[this.el]=true;
			}
		}
		
		
		function MB_BoxOut() {
			MB_els[this.el]=false;
			window.setTimeout( "MB_reallyHide()", MB_delay );
		}
				
		function MB_reallyHide() {
			if( !MB_current ) return;
			if( MB_els[MB_current] ) return;
			MB_current.box.style.display="none";
			MB_current.btn.className="MB_btn";
			MB_current=null;			
		}
				
		function MB_findChildByName( el, name ) {
			var ch = el.firstChild;
			while( ch ) {
				if( ch.nodeName.toUpperCase() == name ) {
					return( ch );
				}
				ch = ch.nextSibling;
			}
			return null;
		}
		
		function MB_browse( n ) {
			var cn = n.className;
			var idx = -1;
			if( cn!=null && cn.indexOf ) idx=cn.indexOf( "MB_menu" );
			if( cn != null && idx>=0 ) {
				MB_Menu( n );
			}
			var ch = n.firstChild;
			while( ch ) {
				if( ch.nodeType == 1 ) 
					MB_browse( ch );
				ch = ch.nextSibling;
			}
		}
		
var BM_btn;
var BM_box;
var BM_show=false;
var BM_delay=100;
function BM_init() {
	BM_btn = document.getElementById( "barMenu" );
	BM_box = document.getElementById( "barMenuBox" );
	if( !BM_btn || !BM_box ) return;
	BM_btn.onmouseover=BM_btnOver;
	BM_btn.onmouseout=BM_btnOut;
	BM_box.onmouseover=BM_boxOver;
	BM_box.onmouseout=BM_boxOut;
	BM_box.style.display="none";
}
function BM_btnOver() {
	BM_box.style.display="block";
	BM_show=true;
}


function BM_btnOut() {
	BM_show=false;
	window.setTimeout( "BM_reallyHide()", BM_delay );
}
function BM_boxOver() {
	BM_show=true;
}
function BM_boxOut() {
	BM_show=false;
	window.setTimeout( "BM_reallyHide()", BM_delay );
}
function BM_reallyHide() {
	if( !BM_show )
		BM_box.style.display="none";
}

