var inmenu=false;var lastmenu=0;var menunow=0;var proposta_menu=0;var oldmenu=0;function scrivilog(funzione){	/*obj=document.getElementById("log");	frase="inmenu "+inmenu+", oldmenu "+oldmenu+", lastmenu "+lastmenu+", menunow "+menunow+", proposta_menu "+proposta_menu+", funzione "+funzione;	console.log(frase);*/}function Menu(current) {   if (!document.getElementById) return; //questo serve per i browsers che non capiscono il dom   if(lastmenu && lastmenu!=current){   		proposta_menu=current;   		window.setTimeout("Menu_control('" + current + "');",500); // la concatenazione di stringhe è per avere current dinamico	}else{		Menu_int(current);		}	scrivilog("menu");}function Menu_control(current) {   if (!document.getElementById) return; //questo serve per i browsers che non capiscono il dom   if(proposta_menu==current && inmenu==false){//inmenu è false perchè non devo essere dentro il sottomenu, se sono uscito da un altro sottomenu ho già impostato imenu a false, e per questo menu non l'ho ancora impostato atrue		proposta_menu=0;		Menu_int(current);		}	scrivilog("menu_control");}function Menu_int(current) {   if (!document.getElementById) return; //questo serve per i browsers che non capiscono il dom   inmenu=true;   oldmenu=lastmenu;   lastmenu=current;   if (oldmenu) Erase(oldmenu);   box=document.getElementById(current);   box.style.display="block";   box.style.zIndex="1";	scrivilog("menu_int");}function Erase(current) {   if (!document.getElementById) return;   if ((inmenu && lastmenu==current)) { //cioè se sono dentro il sottomenu	  return;   }   box=document.getElementById(current);   box.style.zIndex="0";   if(menunow!=current){box.style.display="none";}	scrivilog("erase "+current);}function Timeout(current) {   inmenu=false;   proposta_menu=0   window.setTimeout("Erase('" + current + "');",500); // la concatenazione di stringhe è per avere current dinamico	scrivilog("timeout "+ current);}function Highlight(menu) {   if (!document.getElementById) return;   inmenu=true;   lastmenu=menu;   obj=document.getElementById("t-"+menu);   if(menu!=menunow){	   if(obj.className!=""){			obj.className=obj.className+" menuin";	   }else{			obj.className="menuin";		}   }	scrivilog("Highlight");}function UnHighlight(menu) {   if (!document.getElementById) return; //return: uscire dalla funzione   Timeout(menu);   if(menu!=menunow){	   obj=document.getElementById("t-"+menu);	   if(obj.className!="menuin"){			origine=obj.className;			obj.className=origine.replace(/ menuin/, '');	   }else{			obj.className="";		}   }	scrivilog("UnHighlight");}function nascondi() {   if (!document.getElementById) return; //questo serve per i browsers che non capiscono il dom   inmenu=true;   oldmenu=lastmenu;   lastmenu="";   if(menunow){	   box=document.getElementById(menunow);	   box.style.display="none";   }	scrivilog("nascondi");}function mostra() {   if (!document.getElementById) return; //questo serve per i browsers che non capiscono il dom   inmenu=false;   if(menunow){	   box=document.getElementById(menunow);	   box.style.display="block";   }	scrivilog("mostra");}