//******************* codice statistiche php-stats ******************************

if(document.referrer) var f=document.referrer;
else var f=top.document.referrer;
f=escape(f);
f=f.replace(/&/g,"%A7%A7");
if((f=="null") || (f=="unknown") || (f=="undefined")) f="";
var w=screen.width;
var h=screen.height;
var rand=Math.round(100000*Math.random());
var browser=navigator.appName;
var t=escape(document.title);
var NS_url="";
if(browser!="Netscape") c=screen.colorDepth; else c=screen.pixelDepth;
NS_url=document.URL;
NS_url=escape(NS_url);
NS_url=NS_url.replace(/&/g,"%A7%A7");
var sc1="<img src='http://www.sirai.com/stats/php-stats.php?w="+w+"&amp;h="+h+"&amp;c="+c+"&amp;f="+f+"&amp;NS_url="+NS_url+"&amp;t="+t+"' border='0' alt='' width='1' height='1'>";
document.write(sc1);

//******************* fine codice statistiche php-stats ******************************

window.onerror = null;
window.defaultStatus = '';
var N = navigator.appName;
var V = parseInt(navigator.appVersion);
var loaded=0;
var n3 = (N == "Netscape" && V < 4);
var i3 = (N == "Microsoft Internet Explorer" && V < 4);
var n4 = (N == "Netscape" && V >= 4);
var i4 = (N == "Microsoft Internet Explorer" && V >= 4);
if (n3 || i3)
{
	window.location = "/best_view.htm";
}
var ActiveLayer="";
var ActiveMenu="";
var ActiveSubLayer="";
var ActiveSubMenu="";
var X=0;
var Y=0;
var ActivePopup = "";
var loading = true;
function runClock() {
theTime = window.setTimeout("runClock()", 1000);
var today = new Date();
var display= "SIRAI Elettromeccanica: " + today.toLocaleString();
status=display;
}
runClock();
function posmenu(x){

var mymovie=window.document.mymovie

var a="page";

mymovie.SetVariable(a, x);

}

function writemenu(indice,livello) {
var top = "top.swf"
var level="";
if (livello == 1){level="../";}
if (livello == 2){level="../../";}

//invia link pagina a flash
currenturl=document.location;
address="lingua.php?id="+currenturl;
address=address.replace("&","[");

var x = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="mymovie" id="mymovie" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" WIDTH=600 HEIGHT=107>'
x += '<PARAM NAME=movie VALUE="' + level + top +'?page='+indice+'&livello='+level+'&url='+address+'"><param name="swliveconnect" value="true"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF>'
x += '<EMBED src="' + level + top +'?page='+indice+'&livello='+level+'&url='+address+'" quality=high bgcolor=#FFFFFF  WIDTH=600 HEIGHT=107 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swliveconnect="true" name="mymovie" id="mymovie"></EMBED>'
x += '</OBJECT>'

document.write(x);
//posmenu(indice);
//document.mymovie.SetVariable('page', indice);
//document.close();
}

function writemenueng(indice,livello) {
var top = "top.swf"
var level="";
if (livello == 1){level="../";}
if (livello == 2){level="../../";}

//invia link pagina a flash
currenturl=document.location;
address="lingua.php?id="+currenturl;
address=address.replace("&","[");
var x = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="mymovie" id="mymovie" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" WIDTH=600 HEIGHT=107>'
x += '<PARAM NAME=movie VALUE="' + level + top +'?page='+indice+'&livello='+level+'&url='+address+'"><param name="swliveconnect" value="true"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF>'
x += '<EMBED src="' + level + top +'?page='+indice+'&livello='+level+'&url='+address+'" quality=high bgcolor=#FFFFFF  WIDTH=600 HEIGHT=107 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swliveconnect="true" name="mymovie" id="mymovie"></EMBED>'
x += '</OBJECT>'

document.write(x);
/*
document.mymovie.SetVariable('page', indice);
document.mymovie.SetVariable('livello', level);
currenturl=document.location;
address="lingua.php?id="+currenturl;
document.mymovie.SetVariable('url', address);

//document.close();*/

}

function writemenude(indice,livello) {
var top = "top.swf";
var level="";
if (livello == 1){level="../";}
if (livello == 2){level="../../";}
//invia link pagina a flash
currenturl=document.location;
address="lingua.php?id="+currenturl;
address=address.replace("&","[");
var x = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="mymovie" id="mymovie" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" WIDTH=600 HEIGHT=107>'
x += '<PARAM NAME=movie VALUE="' + level + top +'?page='+indice+'&livello='+level+'&url='+address+'"><param name="swliveconnect" value="true"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF>'
x += '<EMBED src="' + level + top +'?page='+indice+'&livello='+level+'&url='+address+'" quality=high bgcolor=#FFFFFF  WIDTH=600 HEIGHT=107 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swliveconnect="true" name="mymovie" id="mymovie"></EMBED>'
x += '</OBJECT>'
document.write(x);
/*
document.mymovie.SetVariable('page', indice);
document.mymovie.SetVariable('livello', level);
currenturl=document.location;
address="lingua.php?id="+currenturl;
document.mymovie.SetVariable('url', address);
//document.close();*/

}
function foot(livello,logo){
var lev="";
if (livello == 1){lev="../";}
if (livello == 2){lev="../../";}
var immagine='<img border=0 src='+lev+'images/made.gif>';
if (logo == 0) {immagine="";}
x='<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td colspan=3 height=25>&nbsp;</td></tr><tr><td width=65></td><td align=center>';
x+='<a class=menusx2 href=mailto:webmaster@studiosm.it?cc=sirai.web@emerson.com>webmaster&nbsp;&nbsp;&nbsp;</a>|<a class=menusx2 href="javascript:window.open(\'avviso.htm\',\'mail\',\'width=380,height=120,toolbar=no,location=no, status=no,menubar=no,scrollbars=no,resizable=no\'); void(0);">&nbsp;&nbsp;&nbsp;e-mail&nbsp;&nbsp;&nbsp;</a>';
x+='|<a class=menusx2 href="javascript:openNewWindowEx(\''+lev+'privacy.htm\',\'name\',580,600)">&nbsp;&nbsp;&nbsp;privacy&nbsp;&nbsp;&nbsp;</a>|<a class=menusx2 href='+lev+'mappasito.html>&nbsp;&nbsp;&nbsp;mappa del sito</a>';
x+='</td><td width=65 align=right><a class=menusx2 href="javascript:openNewWindowEx(\'made.htm\',\'name\',650,480)">'+immagine+'</a></td></tr></table>';
/*
x='<p align=center><a class=menusx2 href=mailto:webmaster@sirai.com>webmaster&nbsp;&nbsp;&nbsp;</a>|<a class=menusx2 href=mailto:info@sirai.com>&nbsp;&nbsp;&nbsp;e-mail&nbsp;&nbsp;&nbsp;</a>';
x +='   |<a class=menusx2 href="javascript:openNewWindowEx(\''+lev+'privacy.htm\',\'name\',650,480)">&nbsp;&nbsp;&nbsp;privacy&nbsp;&nbsp;&nbsp;</a>|<a class=menusx2 href='+lev+'mappasito.html>&nbsp;&nbsp;&nbsp;mappa del sito</a>';
*/
document.write(x);
}
function foot_eng(livello,logo){
var lev="";
if (livello == 1){lev="../";}
if (livello == 2){lev="../../";}
var immagine='<img border=0 src='+lev+'../images/made.gif>';
if (logo == 0) {immagine="";}
x='<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td colspan=3 height=25>&nbsp;</td></tr><tr><td width=65></td><td align=center>';
x+='<a class=menusx2 href=mailto:webmaster@studiosm.it?cc=sirai.web@emerson.com>webmaster&nbsp;&nbsp;&nbsp;</a>|<a class=menusx2 href="javascript:window.open(\'avviso.htm\',\'mail\',\'width=380,height=120,toolbar=no,location=no, status=no,menubar=no,scrollbars=no,resizable=no\'); void(0);">&nbsp;&nbsp;&nbsp;e-mail&nbsp;&nbsp;&nbsp;</a>';
x+='|<a class=menusx2 href='+lev+'mappasito.html>&nbsp;&nbsp;&nbsp;sitemap</a>';
x+='</td><td width=65 align=right><a class=menusx2 href="javascript:openNewWindowEx(\'made.htm\',\'name\',650,480)">'+immagine+'</a></td></tr></table>';
/*
x='<p align=center><a class=menusx2 href=mailto:webmaster@sirai.com>webmaster&nbsp;&nbsp;&nbsp;</a>|<a class=menusx2 href=mailto:info@sirai.com>&nbsp;&nbsp;&nbsp;e-mail&nbsp;&nbsp;&nbsp;</a>';
x +='   |<a class=menusx2 href='+lev+'mappasito.html>&nbsp;&nbsp;&nbsp;site map</a>';
*/
document.write(x);
}
function SaveMenu ()
{
	this.oButton=null;
	this.oItems=null;
}
LastOpen = new Array ();
for (x=0;x < 5;x++)
	LastOpen[x] = new SaveMenu ();
if (n4 || i4)
{
	if (navigator.appName == "Netscape") 
	{
		layerStyleRef="layer.";
		layerRef="document.layers";
		styleSwitch="";
	}
	else
	{
		layerStyleRef="";
		layerRef="document.all";
		styleSwitch=".style";
	}
}
if (n4)
{
	// document.captureEvents(Event.CLICK);
	document.onclick = onClick;
}
if (i4)
{
	document.onclick = onClick;
}
function onClick ()
{
	hideThisLayer();
	if (ActivePopup.indexOf("_nah_") == -1) 
	{
		closePopup ();
	}
}
function getIndex(el) 
{
	ind = null;
	for (i=0; i<document.layers.length; i++) 
	{
		whichEl = document.layers[i];
		alert ("loop " + whichEl.id);
		if (whichEl.id == el) {
			ind = i;
			break;
		}
	}
	return ind;
}
function arrange()
{
	alert ("dentro 0");
	firstInd = getIndex('T0');
	alert ("dentro " + firstInd);
	
	nextY = document.layers[firstInd].pageY;
	alert ("dentro 2");
	
	
	for (i=firstInd+1; i<document.layers.length; i++)
	{
		alert ("cesare");
		whichEl = document.layers[i];
		if (whichEl.visibility != "hide") 
		{
			alert ("dentro if");
			whichEl.pageY = nextY;
			nextY += whichEl.document.height;
		}
	}
}
function setClass(obj,style)
{
	obj.className = style;
}
function setClassHover(obj)
{
	obj.className = obj.className+"Hover";
}
function setClassNormal(obj)
{
	s = new String (obj.className);
	obj.className = s.replace("Hover","");
}
function setAddress (address)
{
	if (window.parent != null)
		window.parent.location=address;
	else
		window.location=address;
}
function SetMenuLevel (obj,level)
{
	if (i4)
		obj.MenuLevel = level;
}
function getKey (str)
{
	var s = new String ("");
	var start = str.indexOf ("key=");
	
	if (start != -1)
	{
		s = str.substr (start);
		var end = s.indexOf ("&");
		
		if (end != -1)
			s = s.substr (0,end);
	}
	
	return s;
}
function MustOpen (oItem,address)
{
	var ret = false;
	var level = 0;
	
	if (oItem == null)
		return ret;
	var child = oItem.firstChild;
	
	while (child != null)
	{
		if (child.href != null)
		{
			s = new String (child.href);
			if (s.indexOf ("javascript") == -1 &&
			    s.indexOf (".gif") == -1 &&
			    s.indexOf (".jpg"))
			{
				if (s.indexOf ("key=") == -1) 
				{
					var simple_address = new String (child.href);
					var pos = simple_address.indexOf ("?");
					
					if (pos != -1)
						simple_address = simple_address.substr (0,pos-1);
						
					if (address.indexOf (simple_address) != -1 )
					{
						oItem.className="TreeActive";
						child.className="TreeActive";
						ret=true;
					}
				}
				else 
				{
					if (getKey (address) == getKey (child.href))
					{
						oItem.className="TreeActive";
						child.className="TreeActive";
						ret=true;
					}
				}
			}
		}
				
		if (MustOpen (child,address))
			ret = true;
	
		child=child.nextSibling;
	}
	
	return ret;
}
function SetStartup (MaxMenu,image_open)
{
	var x;
	var nameItem;
	var nameButton;
	var oItem;
	var oButton;
	if (n4)
		return;
	address = new String (document.location);
	for (x=0;x < MaxMenu;x++)
	{
		nameItem="T"+x;
		nameButton="B"+x;
		nameMenu="MT"+x;
		
		oItem   = document.all[nameItem];
		oButton = document.all[nameButton];
		oMenu   = document.all[nameMenu];
		
		ok = MustOpen (oItem,address);
		
		if (ok)
		{
			if (oMenu.MenuLevel <= 1)
				oMenu.className = "TreeMenuActive";
			else
				oMenu.className = "TreeActive";
			
			oItem.style.display = "block";
			oButton.src = image_open+oMenu.MenuLevel+".gif";
			LastOpen[oMenu.MenuLevel].oButton=oButton;
			LastOpen[oMenu.MenuLevel].oItems=oItem;
			
		}
	}
	
}
function ToggleDisplay(level,oButton,oItems,image_close,image_open)
{
	var SingleMenu = true;

	if (i4 || n4)
	{
		MenuItem = document.all["M"+oItems.id];
		MenuItem=document.getElementsByTagName(oItems);
		
	
		if ((oItems.style.display == "") || (oItems.style.display == "none")|| (oItems.style.display == "hide"))	
		{
		
			oItems.style.display = "block";
			if(n4){oItems.style.display = "show";}
			oButton.src = image_open;
	
	
			if (LastOpen[level].oItems != null)
				ToggleDisplay (level,LastOpen[level].oButton,LastOpen[level].oItems,image_close,image_open);
	
		
			if (SingleMenu == true)
			{		
				LastOpen[level].oButton=oButton;
				LastOpen[level].oItems=oItems;
			}
			
		}	
		else 
		{
			oItems.style.display = "none";
			oButton.src = image_close;
	
			LastOpen[level].oButton=null;
			LastOpen[level].oItems=null;
		}
	}
}
function doShow (obj)
{
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
doTransIE(obj,5,0.3,1);
}
function resize (evnt)
{
	if (!loading)
		window.history.go(0);
		
	loading = false;
		
}
function showLayer (layer)
{
	if (i4)
		showLayerEx (layer,0,5)
	if (n4)
	{
		var name = 'M'+layer;
		var xOff = document.layers[name].xOff;
		var yOff = document.layers[name].yOff;
		
		showLayerEx (layer,xOff,yOff);
		
	}	
		
}
function openPopup (layer)
{
	var xOff = 0;
	var yOff = 0;
	if (n4 || i4) 
	{
		if (ActivePopup != "")
		{	
			eval(layerRef+'["'+ActivePopup+'"]'+styleSwitch+'.visibility="hidden"');
		}
		ActivePopup = 'L'+ layer;
	
		if (i4)
		{
			var y = ((window.screen.availHeight-100) - document.all[ActivePopup].clientHeight) / 2;
	
			if (y < 20)
				y = 20;
				
			y += body.scrollTop;
	
			
			document.all[ActivePopup].style.left=
				(window.screen.width - document.all[ActivePopup].clientWidth) / 2;
			document.all[ActivePopup].style.top=y;
			
			document.all[ActivePopup].style.visibility='visible';
		
		
		}
		if (n4)
		{
			var y = ((window.innerHeight) - document.layers[ActivePopup].clip.width) / 2;
			y += window.pageYOffset;
			var x = window.innerHeight/2;
			
			if ((y + document.layers[ActivePopup].clip.height)> document.height)
				y = document.height - (document.layers[ActivePopup].clip.height + 50);
		
			document.layers[ActivePopup].pageX = x;
			document.layers[ActivePopup].pageY = y;
			document.layers[ActivePopup].visibility = true;
		
		}
	}
}
function openAbsPopup (layer,x,y)
{
	if (n4 || i4) 
	{
		if (ActivePopup != "")
		{	
			eval(layerRef+'["'+ActivePopup+'"]'+styleSwitch+'.visibility="hidden"');
		}
		ActivePopup = 'L'+ layer;
	
		if (i4)
		{
			document.all[ActivePopup].style.left=x;
			document.all[ActivePopup].style.top=y;
			document.all[ActivePopup].style.visibility='visible';
		}
		if (n4)
		{
			document.layers[ActivePopup].pageX = x;
			document.layers[ActivePopup].pageY = y;
			document.layers[ActivePopup].visibility = true;
		
		}
	}
}
function openPopupFrame (layer,FrameSize)
{
	var xOff = 0;
	var yOff = 0;	
	if (n4 || i4) 
	{
		if (ActivePopup != "")
		{	
			eval(layerRef+'["'+ActivePopup+'"]'+styleSwitch+'.visibility="hidden"');
		}
		ActivePopup = 'L'+ layer;
		ActiveMenu  = 'M'+ layer;
		
		if (i4)
		{
			var x= window[ActiveMenu].offsetLeft + xOff;
			var y= window[ActiveMenu].offsetTop+window[ActiveMenu].offsetHeight+yOff;	
			var parent;
			for (parent=window[ActiveMenu].offsetParent;
				 parent != null;parent=parent.offsetParent)
			{
			   x = x + parent.offsetLeft;
			   y = y + parent.offsetTop;
			}
		
			document.all[ActivePopup].style.left=
				(window.screen.width - document.all[ActivePopup].clientWidth) / 2 + FrameSize;
			document.all[ActivePopup].style.top=body.scrollTop + 
				((window.screen.availHeight-100) - document.all[ActivePopup].clientHeight) / 2;
			
			document.all[ActivePopup].style.visibility='visible';
		
		
		}
		if (n4)
		{
			x = document.layers[ActiveMenu].pageX + xOff;
			y = document.layers[ActiveMenu].pageY + document.layers[ActiveMenu].clip.height+yOff;
			
			document.layers[ActivePopup].left = x;
			document.layers[ActivePopup].top = y;
			document.layers[ActivePopup].visibility = true;
		}
	}
}
function closePopup ()
{
	if (ActivePopup != "")
	{	
		
		eval(layerRef+'["'+ActivePopup+'"]'+styleSwitch+'.visibility="hidden"');
	}
	
	ActivePopup = "";
	
}
function showLayerEx (layer,xOff,yOff)
{
	if (n4 || i4) 
	{
		if (ActiveLayer != "")
		{	
			eval(layerRef+'["'+ActiveLayer+'"]'+styleSwitch+'.visibility="hidden"');
		}
		ActiveLayer = 'L'+ layer;
		ActiveMenu  = 'M'+ layer;
		
		if (i4)
		{
		
			var x= window[ActiveMenu].offsetLeft + xOff;
			var y= window[ActiveMenu].offsetTop+window[ActiveMenu].offsetHeight+yOff;	
			var parent;
			for (parent=window[ActiveMenu].offsetParent;
				 parent != null;parent=parent.offsetParent)
			{
				
			   x = x + parent.offsetLeft;
			   y = y + parent.offsetTop;
			}
			document.all[ActiveLayer].style.left=x-22;
			document.all[ActiveLayer].style.top=y;
			document.all[ActiveLayer].style.visibility='visible';
		
		}
		if (n4)
		{
			x = document.layers[ActiveMenu].pageX + xOff;
			y = document.layers[ActiveMenu].pageY + document.layers[ActiveMenu].clip.height+yOff;
			
			document.layers[ActiveLayer].left = x;
			document.layers[ActiveLayer].top = y;
			document.layers[ActiveLayer].visibility = true;
		}
	}
}
function showSubLayer(layer)
{
	if (n4 || i4) 
	{
		if (ActiveSubLayer != "")
		{	
			eval(layerRef+'["'+ActiveSubLayer+'"]'+styleSwitch+'.visibility="hidden"');
		}
	
		ActiveSubLayer = 'L'+ layer;
		ActiveSubMenu  = 'M'+ layer;
		
		if (i4)
		{
			document.all[ActiveSubMenu].style.color='red';
		
			var x= window[ActiveSubMenu].offsetLeft+window[ActiveSubMenu].offsetWidth;
			var y= window[ActiveSubMenu].offsetTop-1;	
			var parent;
			
			for (parent=window[ActiveSubMenu].offsetParent;
				 parent != null;parent=parent.offsetParent)
				 {
					x = x + parent.offsetLeft;
					y = y + parent.offsetTop;
				 }
			document.all[ActiveSubLayer].style.left=x;
			document.all[ActiveSubLayer].style.top=y;
			doTransIE(ActiveSubLayer,6,0.3,1);
	
		}
		if (n4)
		{
			var parent = document.layers[ActiveLayer];
			var menu = parent.above;
			
			while (menu)
			{
				if (menu.name == ActiveSubMenu)
					break;
				menu = menu.siblingAbove;
			}
			if (menu)
			{
				x = parent.left + parent.clip.right - 15;
				y = menu.pageY + 2;
			
				document.layers[ActiveSubLayer].left = x;
				document.layers[ActiveSubLayer].top = y;
				document.layers[ActiveSubLayer].visibility = true;
			}
		}
	}
}
function hideThisLayer()
{
	hideThisLayerEx(0,5);
}
function hideThisLayerEx()
{
	if (ActiveLayer != "")
	{
		eval(layerRef+'["'+ActiveLayer+'"]'+styleSwitch+'.visibility="hidden"');
		ActiveLayer="";
	}
}
function hideThisLayerExOld(xOff,yOff)
{
	if (n4 || i4) 
	{
		if (ActiveSubLayer == "") 
		{
			var element;
			var parent = null;
				
			if (i4)
			{
				X = window.event.x;
				Y = window.event.y+5;
				
				element = document.elementFromPoint(X,Y);
				
				
				if (element)
				{
					for (parent=element.parentElement;
						 parent!= null;parent=parent.parentElement)
						if (parent.id == ActiveLayer)
							break;
				}
				
				if (!parent)
				{
				
					X = window.event.x;
					Y = window.event.y-5;
					
					element = document.elementFromPoint(X,Y);
					
					
					if (element)
					{
						for (parent=element.parentElement;
							 parent!= null;parent=parent.parentElement)
							if (parent.id == ActiveLayer)
								break;
					}
				
				
				}
				
				
			}
				
			if (n4)
			{
				Y = Y+5;
				x = x+xOff;
					
				var left   = document.layers[ActiveLayer].left;
				var top    = document.layers[ActiveLayer].top;
				var right  = document.layers[ActiveLayer].left + 
							 document.layers[ActiveLayer].clip.right;
				var bottom = document.layers[ActiveLayer].top + 
							 document.layers[ActiveLayer].clip.bottom;
				if (X  >= left && X <= right &&
					Y  >= top  && Y <= bottom )
					parent = true;
					
				if (!parent)
				{
					Y = Y-5;
					x = x+xOff;
						
					var left   = document.layers[ActiveLayer].left;
					var top    = document.layers[ActiveLayer].top;
					var right  = document.layers[ActiveLayer].left + 
								 document.layers[ActiveLayer].clip.right;
					var bottom = document.layers[ActiveLayer].top + 
								 document.layers[ActiveLayer].clip.bottom;
	
	
					if (X  >= left && X <= right &&
						Y  >= top  && Y <= bottom )
						parent = true;
				}
					
					
			}
				
			if (!parent)
			{
				if (i4)
					eval(layerRef+'["'+ActiveLayer+'"]'+styleSwitch+'.visibility="hidden"');
				else
					eval(layerRef+'["'+ActiveLayer+'"]'+styleSwitch+'.visibility="hidden"');
				ActiveLayer="";
			}
		}
	}
}
function hideThisSubLayer()
{
	if (n4 || i4)
	{	
		var element;
		var parent = null;
		var x,y;
		
		if (i4)
		{
			x = window.event.x;
			y = window.event.y;
			element = document.elementFromPoint(x,y);
			
			if (element)
			{
				for (parent=element.parentElement;
					 parent!= null;parent=parent.parentElement)
					if (parent.id == ActiveSubLayer)
						break;
			}
		}
		
		if (n4)
		{
					
			var left   = document.layers[ActiveSubLayer].left;
			var top    = document.layers[ActiveSubLayer].top;
			var right  = document.layers[ActiveSubLayer].left + 
						 document.layers[ActiveSubLayer].clip.right;
			var bottom = document.layers[ActiveSubLayer].top + 
						 document.layers[ActiveSubLayer].clip.bottom;
	
			if (X  >= left && X <= right &&
				Y  >= top  && Y <= bottom )
				parent = true;
		}
		
		
		if (!parent)
		{
			if (i4)
				doTransIE(ActiveSubLayer,7,0.3,0);
			else
				eval(layerRef+'["'+ActiveSubLayer+'"]'+styleSwitch+'.visibility="hidden"');
				
			ActiveSubLayer="";
			hideThisLayer ();
		}
	}
}
function showThisLayer()
{
	if (n4 || i4 && ActiveLayer != "")
		eval(layerRef+'["'+ActiveLayer+'"]'+styleSwitch+'.visibility="visible"');
}
function showThisSubLayer()
{
	if (n4 || i4 && ActiveSubLayer != "")
		eval(layerRef+'["'+ActiveSubLayer+'"]'+styleSwitch+'.visibility="visible"');
}
function openNewWindow(address,name)
{
	
	window.open (address,name,"dependent=yes,toolbar=no,status=no,scrollbars=yes,resizable=yes,alwaysLowered=yes");
}
function openNewWindowEx(address,name,x,y)
{
	var parm = "width="+x+",height="+y+",dependent=yes,toolbar=no,status=no,scrollbars=yes,resizable=no,alwaysRaised=yes";
	window.open (address,name,parm);
}
function openNewWindowEx2(address,name,x,y)
{
	var parm = "width="+x+",height="+y+",dependent=yes,toolbar=no,status=no,scrollbars=no,resizable=no,alwaysRaised=yes";
	window.open (address,name,parm);
}
function grafici(image) {
		
  coin=window.open("","coin","width=692,height=560,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	
  coin.focus();
  coin.document.writeln('<html><title>Diagramma per '+image+'</title><BODY topmargin="0" leftmargin="0" BGCOLOR="#FFFFFF" TEXT="#FFFFFF" LINK="#FF0000" VLINK="#000000">');
  
  coin.document.writeln('<center><a href="javascript:window.close();"><img alt="Clicca qui per chiudere la finestra" src="../images/'+image+'.gif" name="foto">');
  
  
  coin.document.writeln('</a><br><a href="javascript:window.print();"><font face="Arial" size="-1">STAMPA</a></center><br></body></html>');
  
  coin.document.close();
}
function graficieng(image) {
		
  coin=window.open("","coin","width=692,height=560,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	
  coin.focus();
  coin.document.writeln('<html><title>Chart for '+image+'</title><BODY topmargin="0" leftmargin="0" BGCOLOR="#FFFFFF" TEXT="#FFFFFF" LINK="#FF0000" VLINK="#000000">');
  
  coin.document.writeln('<center><a href="javascript:window.close();"><img alt="Click here to close the window" src="../../images/'+image+'.gif" name="foto">');
  
  
  coin.document.writeln('</a><br><a href="javascript:window.print();"><font face="Arial" size="-1">PRINT</a></center><br></body></html>');
  
  coin.document.close();
}
function popup(image,larg,alt,eng) {
		
  coin=window.open("","coin","width="+larg+",height="+alt+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes");
	
  coin.focus();
  coin.document.writeln('<html><title>Sirai Elettromeccanica Srl - Fiere</title><BODY topmargin="0" leftmargin="0" BGCOLOR="#FFFFFF" TEXT="#FFFFFF" LINK="#FF0000" VLINK="#000000">');
  if(eng==1){
  coin.document.writeln('<center><a href="javascript:window.close();"><img border=0 alt="Clck here to close the window" src="../images/'+image+'" name="foto"></a>');
  }
  else{
  coin.document.writeln('<center><a href="javascript:window.close();"><img border=0 alt="Clicca qui per chiudere la finestra" src="images/'+image+'" name="foto"></a>');
  }
  coin.document.close();
}
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if (!window.opera && document.all && this.installedVer.major > 7) {
		// only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
		deconcept.SWFObject.doPrepUnload = true;
	}
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', false);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	useExpressInstall: function(path) {
		this.xiSWFPath = !path ? "expressinstall.swf" : path;
		this.setAttribute('useExpressInstall', true);
	},
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs[variablePairs.length] = key +"="+ variables[key];
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "PlugIn");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "ActiveX");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}
/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
		var axo = 1;
		var counter = 3;
		while(axo) {
			try {
				counter++;
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
//				document.write("player v: "+ counter);
				PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
			} catch (e) {
				axo = null;
			}
		}
	} else { // Win IE (non mobile)
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if (param == null) { return q; }
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	var objects = document.getElementsByTagName("OBJECT");
	for (var i = objects.length - 1; i >= 0; i--) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
if (deconcept.SWFObject.doPrepUnload) {
	if (!deconcept.unloadSet) {
		deconcept.SWFObjectUtil.prepUnload = function() {
			__flash_unloadHandler = function(){};
			__flash_savedUnloadHandler = function(){};
			window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
		}
		window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
		deconcept.unloadSet = true;
	}
}
/* add document.getElementById if needed (mobile IE < 5) */
if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}
/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;
