<!--
//Region Global Variables
var MNet_SelectedMenuStyleInfos=new Object();
var MNet_UnselectedMenuStyleInfos=new Object();
var MNet_MenuFadeDelays=new Object();
var MNet_clockValue=0;
var MNet_ticker;
var MNet_highlightTopMenus=new Object();
var MNet_images=new Array();
var MNet_OpenMenuItems = new Array();
//EndRegion
//Region Methods to hook up a menu to the global variables
function Registra_Menu(menuID, selectedStyleInfo, unselectedStyleInfo, menuFadeDelay, highlightTopMenu){
	MNet_SelectedMenuStyleInfos[menuID]=selectedStyleInfo;
	MNet_UnselectedMenuStyleInfos[menuID]=unselectedStyleInfo;
	MNet_MenuFadeDelays[menuID]=menuFadeDelay;
	MNet_highlightTopMenus[menuID]=highlightTopMenu;
}
//Region The methods and contructor of the Info_Stile object.
function Applica_Info_Stile(element){
	element.style.backgroundColor=this.backgroundColor;
	element.style.borderColor=this.borderColor;
	element.style.borderStyle=this.borderStyle;
	element.style.borderWidth=this.borderWidth;
	element.style.color=this.color;
	if (this.fontFamily!='')
		element.style.fontFamily=this.fontFamily;
	element.style.fontSize=this.fontSize;
	element.style.fontStyle=this.fontStyle;
	element.style.fontWeight=this.fontWeight;
	if (this.className!='')
		element.style.className=this.className;
}
function Info_Stile(backgroundColor,borderColor,borderStyle,borderWidth,color,fontFamily,fontSize,fontStyle,fontWeight,className){
	this.backgroundColor=backgroundColor;
	this.borderColor=borderColor;
	this.borderStyle=borderStyle;
	this.borderWidth=borderWidth;
	this.color=color;
	this.fontFamily=fontFamily;
	this.fontSize=fontSize;
	this.fontStyle=fontStyle;
	this.fontWeight=fontWeight;
	this.className=className;
	this.applyToElement=Applica_Info_Stile;
}
//Region MouseEventHandlers
function EventoMouseOver(menuID,elem,parent,displayedVertically,imageSource){
	stopTick();
	ChiudiSottoMenu(elem);
	var childID=elem.id+"SottoMenu";  // Display child menu if needed
	if (document.getElementById(childID)!=null){  // make the child menu visible and specify that its position is specified in absolute coordinates
	
	/* Codice aggiunto in data 18/02/2005 per effettuare all'apertura di un 
	sotto menu il filtro blendTrans. Sul file CSS, nella classe del sottomenu, deve essere presente
	il filtro blendTrans.
	Questo codice funziona solo con Internet Explorer, con un altro browser il filtro viene saltato */
	 if (document.all)
	{
	  document.getElementById(childID).filters.blendTrans.Apply();
	  document.getElementById(childID).filters.blendTrans.Play();
	}
	//--------------------------------------------------------------------------------

		document.getElementById(childID).style.display='block';
		document.getElementById(childID).style.position='absolute';
		MNet_OpenMenuItems = MNet_OpenMenuItems.concat(childID);
		if (displayedVertically){ // Set the child menu's left and top attributes according to the menu's offsets
			document.getElementById(childID).style.left=getAscendingLefts(parent)+parent.offsetWidth;
			document.getElementById(childID).style.top=getAscendingTops(elem);
			var visibleWidth=parseInt(window.outerWidth?window.outerWidth-9:document.body.clientWidth,10);
			if ((parseInt(document.getElementById(childID).offsetLeft,10)+parseInt(document.getElementById(childID).offsetWidth,10))>visibleWidth) {
				document.getElementById(childID).style.left=visibleWidth-parseInt(document.getElementById(childID).offsetWidth,10);
			}
		}else{  // Set the child menu's left and top attributes according to the menu's offsets
			document.getElementById(childID).style.left=getAscendingLefts(elem);
			document.getElementById(childID).style.top=getAscendingTops(parent)+parent.offsetHeight;
			if (document.getElementById(childID).offsetWidth<elem.offsetWidth)
				document.getElementById(childID).style.width=elem.offsetWidth;
		}
	}
	if (MNet_SelectedMenuStyleInfos[menuID] != null) MNet_SelectedMenuStyleInfos[menuID].applyToElement(elem);
	if (MNet_highlightTopMenus[menuID]){
		var eId=elem.id+'';
		while (eId.indexOf('SottoMenu')>=0){
			eId=eId.substring(0, eId.lastIndexOf('SottoMenu'));
			MNet_SelectedMenuStyleInfos[menuID].applyToElement(document.getElementById(eId));
		}
	}	
	if (imageSource!=''){
		setimage(elem,imageSource)
	}
}
function EventoMouseClick(menuID,elem,parent,imageSource){
	stopTick();
	if (MNet_SelectedMenuStyleInfos[menuID] != null) MNet_SelectedMenuStyleInfos[menuID].applyToElement(elem);
	if (MNet_highlightTopMenus[menuID]){
		var eId=elem.id+'';
		while (eId.indexOf('SottoMenu')>=0){
			eId=eId.substring(0, eId.lastIndexOf('SottoMenu'));
			MNet_SelectedMenuStyleInfos[menuID].applyToElement(document.getElementById(eId));
		}
	}	
	if (imageSource!=''){
		setimage(elem,imageSource)
	}
}
function EventoMouseOverSpacer(menuID,elem,parent){
	stopTick();
}
function EventoMouseOut(menuID,elem,imageSource){
	doTick(menuID);
	if (MNet_UnselectedMenuStyleInfos[menuID] != null) MNet_UnselectedMenuStyleInfos[menuID].applyToElement(elem);
	if (MNet_highlightTopMenus[menuID]){
		var eId=elem.id+'';
		while (eId.indexOf('SottoMenu')>=0){
			eId=eId.substring(0, eId.lastIndexOf('SottoMenu'));
			MNet_UnselectedMenuStyleInfos[menuID].applyToElement(document.getElementById(eId));
		}
	}
	if (imageSource!=''){
		setimage(elem,imageSource)
	}
}
function EventoMouseOutSpacer(menuID, elem){
	doTick(menuID);
}
//Region Utility Functions
function ChiudiSottoMenu(parent){
	if (MNet_OpenMenuItems == "undefined") return;
	for (var i=MNet_OpenMenuItems.length-1; i>-1;i--) {
		if (parent.id.indexOf(MNet_OpenMenuItems[i]) != 0) {
			document.getElementById(MNet_OpenMenuItems[i]).style.display = 'none';
			SettaVisibilitaIFRAME(false, MNet_OpenMenuItems[i]);
			MNet_OpenMenuItems = new Array().concat(MNet_OpenMenuItems.slice(0, i), MNet_OpenMenuItems.slice(i+1));
  		} 
	}
}
function SettaVisibilitaIFRAME(makevisible, tableid){
	var tblRef=document.getElementById(tableid);
	var IfrRef=document.getElementById('shim'+tableid);
	if (tblRef!=null && IfrRef!=null){
		if(makevisible){
			IfrRef.style.width=tblRef.offsetWidth;
			IfrRef.style.height=tblRef.offsetHeight;
			IfrRef.style.top=tblRef.style.top;
			IfrRef.style.left=tblRef.style.left;
			IfrRef.style.zIndex=tblRef.style.zIndex-1;
			IfrRef.style.display="block";
		}else{
			IfrRef.style.display="none";
		}
	}
}
function IsSottoMenu(id){
	if(typeof(MNet_subMenuIDs)=='undefined') return false;
	for (var i=0;i<MNet_subMenuIDs.length;i++)
	  if (id==MNet_subMenuIDs[i]) return true;
	return false;
}
function getAscendingLefts(elem){
	if (elem==null)
		return 0;
	else
	{
		if ((elem.style.position=='absolute' || elem.style.position=='relative') && !IsSottoMenu(elem.id)) return 0;
		return elem.offsetLeft+getAscendingLefts(elem.offsetParent);
	}
}
function getAscendingTops(elem){
	if (elem==null)
		return 0;
	else {
		if ((elem.style.position=='absolute' || elem.style.position=='relative') && !IsSottoMenu(elem.id)) return 0;
		return elem.offsetTop+getAscendingTops(elem.offsetParent);
	}
}
//Region Fade Functions
function doTick(menuID){
	if (MNet_clockValue>=MNet_MenuFadeDelays[menuID]){
		stopTick();
		ChiudiSottoMenu(document.getElementById(menuID));
	} else {
		MNet_clockValue++;
		MNet_ticker=setTimeout("doTick('"+menuID+"');", 500);
	}
}
function stopTick(){
	MNet_clockValue=0;
	clearTimeout(MNet_ticker);
}
function preloadimages(){
	for (i=0;i<preloadimages.arguments.length;i++){
		MNet_images[i]=new Image();
		MNet_images[i].src=preloadimages.arguments[i];
	}
}
function setimage(elem,imageSource){
	var i=elem.getElementsByTagName("img")[0];
	i.src=imageSource;
}
//-->