<!-- //
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}
addLoadEvent(compatta);

/* Nasconde tutti le liste (ul) con class impostato a "compatta" */
function compatta() { 
	if (!document.getElementsByTagName) return;
	var liste = document.getElementsByTagName("ul");
	for (var i=0; i<liste.length; i++) { 
		var lista = liste[i]; 
		if (lista.className== "compatta") {
			lista.style.display = "none";
		}
	}
}

function swapDiv(divMostra, divNascosti) {
	/* funzione per visualizzare un div e nascondere gli altri */
	var divMostra, divNascosti;
	
	for (var i = 0; i < divNascosti.length; i++) {
		if (divNascosti[i] == divMostra) {
			if (document.getElementById(divMostra).style.display == "block") {
				document.getElementById(divMostra).style.display = "none";
			} else {
				document.getElementById(divMostra).style.display = "block";
			}
		} else {
			document.getElementById(divNascosti[i]).style.display = "none";
		}
	}
}
// -->