// -------------------------------------------- script per target_blank accessibile ----------------------
function inizializza() {
	a = document.getElementsByTagName('A');  // identifica tutti gli elementi A presenti nella pagina
	for(i=0;a[i];i++) if(a[i].className.indexOf('blank') != -1) {  // verifica che il link sia associato alla classe blank;
		a[i].title += "new window"; // aggiunge "new window" al "title" dei link
		a[i].onclick = function () {window.open(this.href, '_blank');return false;};
		a[i].onkeypress = function (e) {
			k = (e) ? e.keyCode : window.event.keyCode;
			if(k==13) {
				window.open(this.href, '_blank');
				return false;
				}
			}
		}
	}
	window.onload = function() {inizializza();
}


// -------------------------------------------- script per popup NON accessibile ----------------------
function newWindow() 
{
//window.open("","coverwindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=420,height=330");
	popup=window.open("","coverwindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=480,height=480");
	popup.focus();
}


function newWindow2()
// per popup database
{
	popup=window.open("","coverwindow","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,width=910,height=650");
	popup.focus();
}

// -------------------------------------------- script per stampa ----------------------
function stampa()
  {
  self.print();
  }


// -------------------------------------------- script per collassare div ----------------------
if (document.getElementById)
	{
		document.write('<style type="text/css">\n')
		document.write('.submenu{display: none;}\n')
		document.write('</style>\n')
	}

function SwitchMenu(obj)
	{
		if(document.getElementById)
	{
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span");
		if(el.style.display != "block")
			{
				el.style.display = "block";
			}
		else
			{
				el.style.display = "none";
			}
	}
}