// Funzione per mostrare/nascondere un DIV generico (toggle) - By Daniele Cascone ---
function espandi(idElemento) {
	var itemMenu = document.getElementById(idElemento);
	if (itemMenu.className=="visibile") {
		itemMenu.className="invisibile";
	}
	else {
		itemMenu.className="visibile";
	}
}

// Funzione per espandere i numeri pagina (applicabile anche ad altri elementi con lo stesso comportamento)
function espandiPagine(idLink,idElementiNascosti) {
	var itemTutteLePagine = document.getElementById(idLink);
	itemTutteLePagine.className="invisibile";
	espandi(idElementiNascosti); // Richiama la funzione per mostrare/nascondere un DIV generico (toggle)
}

// Funzione per centrare il popup dello slideshow
function centraSlideShow(theUrl) {
	var theUrl;
	var t;
	var l;
	t=(screen.height - 712) / 2;
	l=(screen.width - 808) / 2;
	window.open(theUrl,'slideshow','top='+t+',left='+l+',resizable=yes,scrollbars=no,width=800,height=670');
}

// Funzione per decriptare l'email (mws e reflectiva):
function mwsMail() {
	var first = 'ma';
	var second = 'il';
	var third = 'to:';
	var address = '&#109;&#97;&#105;&#108;';
	var domain = '&#100;&#97;&#110;&#105;&#101;&#108;&#101;&#99;&#97;&#115;&#99;&#111;&#110;&#101;&#46;&#99;&#111;&#109;';
	document.write('<a href="');
	document.write(first+second+third);
	document.write(address);
	document.write('&#64;');
	document.write(domain);
	document.write('">');
    document.write(address);
    document.write('&#64;');
    document.write(domain);
	document.write('<\/a>');
}

// Funzione per decriptare un form
function formDecr(nome,file,est,tipo) {
	if (tipo == "open") { // con passaggio di parametri
		var HTMLForm =  '%3C' + 'form name="' + nome + '" method="post"' + ' action="' + file + '.' + est + '"' + '%3E';
	} else { // nessun parametro passato
		var HTMLForm =  '%3C' + '/form' + '%3E';
	}
	document.write(unescape(HTMLForm));
}