<!--
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "Browser sconosciuto";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "Sistema operativo";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();


// funzione apertura box popup
function move_box(an, box) {
  var cleft = -250;
  var ctop = -20;
  var obj = an;
  while (obj.offsetParent) {
    cleft += obj.offsetLeft;
    ctop += obj.offsetTop;
    obj = obj.offsetParent;
  }
  box.style.left = cleft + 'px';
  ctop += an.offsetHeight + 8;

  if (document.body.currentStyle &&
    document.body.currentStyle['marginTop']) {
    ctop += parseInt(
      document.body.currentStyle['marginTop']);
  }
  box.style.top = ctop + 'px';
}

function show_hide_box_borsa(an, width, height, borderStyle) {
  var href = an.href;
  var boxdiv = document.getElementById(href);
  if (boxdiv != null) {
    if (boxdiv.style.display=='none') {
      move_box(an, boxdiv);
      boxdiv.style.display='block';
    } else
      boxdiv.style.display='none';
    return false;  
  } 
  
	  boxdiv = document.createElement('div');
	  boxdiv.setAttribute('id', href);
	  boxdiv.style.display = 'block';
	  boxdiv.style.position = 'absolute';
	  boxdiv.style.width = width + 'px';
	  boxdiv.style.height = height + 'px';
	  boxdiv.style.border = borderStyle;
	  boxdiv.style.backgroundColor = '#ffffff';
	
	  var contents = document.createElement('iframe');
	  contents.scrolling = 'no';
	  contents.frameBorder = '0';
	  contents.style.width = width + 'px';
	  contents.style.height = height + 'px';
	  contents.src = href;
	
	  boxdiv.appendChild(contents);
	  document.body.appendChild(boxdiv);
	  move_box(an, boxdiv);
	
	  return false;
}
  
function show_hide_box_economia(an, width, height, borderStyle) {
  var href = an.href;
  var boxdiv1 = document.getElementById(href);
 
  if (boxdiv1 != null) {
    if (boxdiv1.style.display=='none') {
      move_box(an, boxdiv1);
      boxdiv1.style.display='block';
    } else
      boxdiv1.style.display='none';
    return false;  
  }
	
	  boxdiv1 = document.createElement('div');
	  boxdiv1.setAttribute('id', href);
	  boxdiv1.style.display = 'block';
	  boxdiv1.style.position = 'absolute';
	  boxdiv1.style.width = width + 'px';
	  boxdiv1.style.height = height + 'px';
	  boxdiv1.style.border = borderStyle;
	  boxdiv1.style.backgroundColor = '#ffffff';
	
	  var contents = document.createElement('iframe');
	  contents.scrolling = 'no';
	  contents.frameBorder = '0';
	  contents.style.width = width + 'px';
	  contents.style.height = height + 'px';
	  contents.src = href;
	
	  boxdiv1.appendChild(contents);
	  document.body.appendChild(boxdiv1);
	  move_box(an, boxdiv1);
	
	  return false;
}

// -->
