
/*	File layout_app.js											*/

/*	Directory root_pug											*/

/*	Versione del 13/01/2010										*/

/*	--------------------------------------------------------------	*/

/*	Caricamento del CSS in funzione della larghezza della finestra	*/
/*	e del numero di colonne (2 o 3)					*/

/*	Versione del 30/06/2008 - 23/07/08 - 01/10/08 - 25/11/08		*/
/*	Versione del 28/07/2009											*/

var	gl_nome_layout_completo;

if (gl_nome_layout == "")
alert("Error - Layout_app.js - Variable gl_nome_layout vuota. Caricamento css fallito.");
else {

	if (gl_nome_layout.charAt(gl_nome_layout.length-1) != "_")
	alert("Warning - Layout_app.js - Variable gl_nome_layout errata. Fallimento del caricamento css probabile.");
	
//	Pezzo di codice da togliere quando tutti i menu.js chiameranno la funzione path_relativo()
//	25-11-08
//	==========================================================================================

	if (gl_path == -1)
	{	/* alert("menu.js non contiene la chiamata alla funzione path_relativo()"); */
		if (gl_livello == 0) gl_path = "";
		else
		if (gl_livello == 1) gl_path = "../";
		else
		if (gl_livello == 2) gl_path = "../../";
		else
		if (gl_livello == 3) gl_path = "../../../";
		else alert("Error - Layout_app.js - Variable gl_livello errata = " + gl_livello + ". Caricamento css fallito.");
	}
//	==========================================================================================

	gl_nome_layout_completo = "zz1_cssjs/";

	if (gl_col == 1) gl_nome_layout_completo = gl_nome_layout_completo + gl_nome_layout + "1_";
	else
	if (gl_col == 2) gl_nome_layout_completo = gl_nome_layout_completo + gl_nome_layout + "2_";
	else
	if (gl_col == 3) gl_nome_layout_completo = gl_nome_layout_completo + gl_nome_layout + "3_";
	else
	{	gl_nome_layout_completo = "";
		alert("Error - Layout_app.js - Variable gl_col errata = " + gl_col + ". Caricamento css fallito.");
	}

	if (dim_finestra == "low")  	/* 800 x 600 */
	{	document.write("<link rel=stylesheet href=" + gl_path + "zz1_cssjs/library_800.css type=text/css>");
		document.write("<link rel=stylesheet href=" + gl_path + gl_nome_layout_completo + "800.css type=text/css>");
		document.write("<link rel=stylesheet href=user_800.css type=text/css>");
	}
	else if (dim_finestra == "high") 	/* 1024 x 768 */
	{	document.write("<link rel=stylesheet href=" + gl_path + "zz1_cssjs/library_1024.css type=text/css>");
		document.write("<link rel=stylesheet href=" + gl_path + gl_nome_layout_completo + "1024.css type=text/css>");
		document.write("<link rel=stylesheet href=user_1024.css type=text/css>");
	} 
	else  if (dim_finestra == "large")	/* 1280 x 800 oppure 1024 */
	{	document.write("<link rel=stylesheet href=" + gl_path + "zz1_cssjs/library_1280.css type=text/css>");
		document.write("<link rel=stylesheet href=" + gl_path + gl_nome_layout_completo + "1280.css type=text/css>");
		document.write("<link rel=stylesheet href=user_1280.css type=text/css>");
	}
	else  if (dim_finestra == "xl")		/* 1400 x 1050 */
	{	document.write("<link rel=stylesheet href=" + gl_path + "zz1_cssjs/library_1400.css type=text/css>");
		document.write("<link rel=stylesheet href=" + gl_path + gl_nome_layout_completo + "1400.css type=text/css>");
		document.write("<link rel=stylesheet href=user_1400.css type=text/css>");
	}
	else
	{	document.write("<link rel=stylesheet href=" + gl_path + "zz1_cssjs/library_1600.css type=text/css>");
		document.write("<link rel=stylesheet href=" + gl_path + gl_nome_layout_completo + "1600.css type=text/css>");
		document.write("<link rel=stylesheet href=user_1600.css type=text/css>");
	}

		document.write("<link rel=stylesheet href=" + gl_path + "zz1_cssjs/library_print.css type=text/css media=print>");
		document.write("<link rel=stylesheet href=" + gl_path + gl_nome_layout_completo + "print.css type=text/css media=print>");
		
		document.write("<link rel=stylesheet href=user_print.css type=text/css media=print>");
 
/*	28/07/2009 - E' stato esteso a Chrome e Safari questa riga riservata a Firefox	*/
	if (tipo_browser == "mz" || tipo_browser == "cr" || tipo_browser == "sa")
	{	document.write("<link rel=stylesheet href=" + gl_path + "zz1_cssjs/library_firefox.css type=text/css>");
		document.write("<link rel=stylesheet href=" + gl_path + "zz1_cssjs/layout_mz_print.css type=text/css media=print>");
	}
}
	
/*	++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++	*/

/*	-----------------------------------------------------------------------------	*/
/*	Funzioni per il caricamento del banner											*/
/*	------------------------------------------------------------------------------	*/

/*	Funzione scrivi_logo_top(lang)							*/

/*	Versione del 24/09/2008 - 05/06/2009					*/

/*	La variabile gl_dir_banner è definita nel file menu.js	*/

function scrivi_logo_top (lang)  {
	
	retour = scrivi_logo_top_core(lang, gl_dir_banner);
	
	return retour;
}

/*	------------------------------------------------------------------------------	*/

/*	Funzione scrivi_logo_top_interno (lang, dir_banner)		*/

/*	Versione del 24/09/2008 - 05/06/2009					*/

/*	Cliccando sull'immagine si raggiunge l'indirizzo							*/
/*	contenuto nella variabile globale logo_link									*/

/*	In input: gl_use_map_top[0]. Se vale "y" viene gestito il link sul logo		*/

function scrivi_logo_top_core (lang, dir_banner)  {

	var i, dim, stringa, relative_logo_link;
	var use_map, coordinate, ext;
	
	ext = ".jpg";
	use_map = "";
	coordinate = " coords='";

	if (lang != "it" && lang != "en" && lang != "fr" && lang != "sp" && lang != "pt" && lang != "de")
	{	alert("Funz. scrivi_logo_top_interno() - lingua: '" + lang + "' non supportata.");
		return false;
	}
	
	if (dir_banner == "")
	{	alert("Funz. scrivi_logo_top_interno() - Variabile Directory banner (dir_banner) vuota.");
		return false;
	}
	
	if (dir_banner.indexOf("zz1_banner/") != 0)
	{	alert("Funz. scrivi_logo_top_interno() - Variabile Directory banner (dir_banner) errata.");
		alert("Funz. scrivi_logo_top_interno() - Recovery in progress.");	
		dir_banner = "zz1_banner/standard/";
	}	
	
	dim = lista_lingue.length;
	for (i=0; i<dim; i++)
	{	if (lang == lista_lingue[i]) { stringa = banner_alt[i]; break; }
	}
	
/*	Calcolo dell'indirizzo dove andare quando si clicca sul banner	*/
/*	in funzione delle variabili gl_livello e gl_nome_hp			*/
	
	if (gl_livello == 0) relative_logo_link = gl_nome_hp;
	else
	{	relative_logo_link = "";
		for (i=0; i<gl_livello; i++) relative_logo_link = relative_logo_link + "../";
		relative_logo_link = relative_logo_link + gl_nome_hp;
	}
	
/*	Scrittura del banner _top	*/
	
	if (gl_use_map_top[0] == "y" && fichier() != relative_logo_link) use_map = " usemap='#map_logo'";	/* modif. 24-09-08	*/

	if (dim_finestra == "low")  		/* 800 x 600 */
	{	document.write("<img id='logo_top' src='" + gl_path + dir_banner + "banner_800_top_" + lang + ext + "'" + use_map + ">");
		coordinate = coordinate + gl_use_map_top[1][0] + "," + gl_use_map_top[2][0] + "," + gl_use_map_top[3][0] + "," + gl_use_map_top[4][0] + "'"; 
	}
	else if (dim_finestra == "high") 	/* 1024 x 768 */
	{	document.write("<img id='logo_top' src='" + gl_path + dir_banner + "banner_1024_top_" + lang + ext + "'" + use_map + ">");
		coordinate = coordinate + gl_use_map_top[1][1] + "," + gl_use_map_top[2][1] + "," + gl_use_map_top[3][1] + "," + gl_use_map_top[4][1] + "'"; 
	} 
	else  if (dim_finestra == "large")	/* 1280 x 800 oppure 1024 */
	{	document.write("<img id='logo_top' src='" + gl_path + dir_banner + "banner_1280_top_" + lang + ext + "'" + use_map + ">");
		coordinate = coordinate + gl_use_map_top[1][2] + "," + gl_use_map_top[2][2] + "," + gl_use_map_top[3][2] + "," + gl_use_map_top[4][2] + "'"; 
	}
	else  if (dim_finestra == "xl")		/* 1400 x 1050 */
	{	document.write("<img id='logo_top' src='" + gl_path + dir_banner + "banner_1400_top_" + lang + ext + "'" + use_map + ">");
		coordinate = coordinate + gl_use_map_top[1][3] + "," + gl_use_map_top[2][3] + "," + gl_use_map_top[3][3] + "," + gl_use_map_top[4][3] + "'"; 
	}
	else
	{	document.write("<img id='logo_top' src='" + gl_path + dir_banner + "banner_1600_top_" + lang + ext + "'" + use_map + ">");
		coordinate = coordinate + gl_use_map_top[1][4] + "," + gl_use_map_top[2][4] + "," + gl_use_map_top[3][4] + "," + gl_use_map_top[4][4] + "'"; 
	}
	
	if (gl_use_map_top[0] == "y" && fichier() != relative_logo_link)					/* modif. 24-09-08	*/ 
	{	document.write("<map name='map_logo'>");
		document.write("<area shape='rect' href='" + relative_logo_link + "' alt='" + stringa + "'" + coordinate + ">");
		document.write("</map>");
	}
	
	return true;
}

/*	++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++	*/

/*	Funzione scrivi_logo_bottom(lang) - Versione del 24/09/2008			*/

/*	Cliccando sull'immagine si raggiunge l'indirizzo				*/
/*	contenuto nella variabile globale logo_link					*/

/*	In input: gl_use_map_bottom[0]. Se vale "y" viene gestito il link sul logo	*/

function scrivi_logo_bottom (lang)  {
	var i, dim, stringa, relative_logo_link;
	var use_map, coordinate, ext;
	
	ext = ".png";
	use_map = "";
	coordinate = " coords='";

	if (lang != "it" && lang != "en" && lang != "fr" && lang != "sp" && lang != "pt" && lang != "de")
	{	alert("Funz. scrivi_logo_bottom() - lingua: '" + lang + "' non supportata.");
		return false;
	}
	
	if (gl_dir_banner == "")
	{	alert("Funz. scrivi_logo_bottom() - Variabile Directory banner (gl_dir_banner) vuota.");
		return false;
	}
	
	dim = lista_lingue.length;
	for (i=0; i<dim; i++)
	{	if (lang == lista_lingue[i]) { stringa = banner_alt[i]; break; }
	}
	
/*	Calcolo dell'indirizzo dove andare quando si clicca sul banner	*/
/*	in funzione delle variabili gl_livello e gl_nome_hp		*/
	
	if (gl_livello == 0) relative_logo_link = gl_nome_hp;
	else
	{	relative_logo_link = "";
		for (i=0; i<gl_livello; i++) relative_logo_link = relative_logo_link + "../";
		relative_logo_link = relative_logo_link + gl_nome_hp;
	}
	
/*	Scrittura del banner _bottom	*/
	
	if (gl_use_map_bottom[0] == "y" && fichier() != relative_logo_link) use_map = " usemap='#map_logo'";	/* modif. 24-09-08	*/

	if (dim_finestra == "low")  		/* 800 x 600 */
	{	document.write("<img id='logo_bottom' src='" + gl_path + gl_dir_banner + "banner_800_bottom_" + lang + ext + "'" + use_map + ">");
		coordinate = coordinate + gl_use_map_bottom[1][0] + "," + gl_use_map_bottom[2][0] + "," + gl_use_map_bottom[3][0] + "," + gl_use_map_bottom[4][0] + "'"; 
	}
	else if (dim_finestra == "high") 	/* 1024 x 768 */
	{	document.write("<img id='logo_bottom' src='" + gl_path + gl_dir_banner + "banner_1024_bottom_" + lang + ext + "'" + use_map + ">");
		coordinate = coordinate + gl_use_map_bottom[1][1] + "," + gl_use_map_bottom[2][1] + "," + gl_use_map_bottom[3][1] + "," + gl_use_map_bottom[4][1] + "'"; 
	} 
	else  if (dim_finestra == "large")	/* 1280 x 800 oppure 1024 */
	{	document.write("<img id='logo_bottom' src='" + gl_path + gl_dir_banner + "banner_1280_bottom_" + lang + ext + "'" + use_map + ">");
		coordinate = coordinate + gl_use_map_bottom[1][2] + "," + gl_use_map_bottom[2][2] + "," + gl_use_map_bottom[3][2] + "," + gl_use_map_bottom[4][2] + "'"; 
	}
	else  if (dim_finestra == "xl")		/* 1400 x 1050 */
	{	document.write("<img id='logo_bottom' src='" + gl_path + gl_dir_banner + "banner_1400_bottom_" + lang + ext + "'" + use_map + ">");
		coordinate = coordinate + gl_use_map_bottom[1][3] + "," + gl_use_map_bottom[2][3] + "," + gl_use_map_bottom[3][3] + "," + gl_use_map_bottom[4][3] + "'"; 
	}
	else
	{	document.write("<img id='logo_bottom' src='" + gl_path + gl_dir_banner + "banner_1600_bottom_" + lang + ext + "'" + use_map + ">");
		coordinate = coordinate + gl_use_map_bottom[1][4] + "," + gl_use_map_bottom[2][4] + "," + gl_use_map_bottom[3][4] + "," + gl_use_map_bottom[4][4] + "'"; 
	}
	
	if (gl_use_map_bottom[0] == "y" && fichier() != relative_logo_link)					/* modif. 24-09-08	*/ 
	{	document.write("<map name='map_logo'>");
		document.write("<area shape='rect' href='" + relative_logo_link + "' alt='" + stringa + "'" + coordinate + ">");
		document.write("</map>");
	}
	
	return true;
}

/*    --------------------------------------------------------	*/
/*	Funzioni per la scrittura del footer				*/
/*    --------------------------------------------------------	*/

/*	Funzione scrivi_dua(lang) - Versione del 22/05/2008		*/

/*	DUA: Data Ultimo Aggiornamento					*/

function scrivi_dua (lang)  {
	var i, dim, stringa, sito_in_costruzione;

	if (lang != "it" && lang != "en" && lang != "fr" && lang != "sp" && lang != "pt" && lang != "de")
	{	alert("Funz. scrivi_dua() - lingua: '" + lang + "' non supportata.");
		return false
	}

	dim = lista_lingue.length;
	for (i=0; i<dim; i++)
	{	if (lang == lista_lingue[i]) { stringa = gl_dua[i]; break; }
	}
	
/*	Ricerca del messaggio relativo al sito in costruzione 	*/

	if (lang == "it") sito_in_costruzione = "<span style='color: white; font-weight: bold;'>Attenzione: il sito dell'Universit&#224; &#232; in fase di ristrutturazione. Avete raggiunto una nuova pagina. Per qualsiasi suggerimento e/o commento </span><a href='" + gl_path + "Univ/contact/contatta_webmaster_it.html'><img class='testo_al_m' src='" + gl_path + "zz1_icons/gl_email_1.gif' width='13' height='11'></a><br>";
	else 
	if (lang == "en") sito_in_costruzione = "<span style='color: white; font-weight: bold;'>Attention: the Website is currently under update. You reach a new page. For any comment or suggestion, please contact the Website Responsible </span><a href='" + gl_path + "Univ/contact/contatta_webmaster_en.html'><img class='testo_al_m' src='" + gl_path + "zz1_icons/gl_email_1.gif' width='13' height='11'></a><br>";
	
/*	stringa = sito_in_costruzione + stringa;	*/
	
	document.write(stringa);
	
	return true;
}

/*	--------------------------------------------------------------	*/

/*	Funzione scrivi_footer(lang)						*/

/*	28/04/2008: gestice soltanto it e en					*/
/*	02/07/2008: è stato aggiunto sp						*/

function scrivi_footer (lang)  {

	if (lang != "it" && lang != "en" && lang != "fr" && lang != "sp" && lang != "pt" && lang != "de")
	{	alert("Funz. scrivi_footer() - lingua: '" + lang + "' non supportata.");
		return false
	}

	if (lang == "it") document.write("Copyright &#169; 2000 - Pontificia Universit&#224; Gregoriana<br>Piazza della Pilotta, 4 - 00187 Roma");
	else 
	if (lang == "en") document.write("Copyright &#169; 2000 - Pontifical Gregorian University<br>Piazza della Pilotta, 4 - 00187 Rome (Italy)");
	else 
	if (lang == "sp") document.write("Copyright &#169; 2000 - Pontificia Universidad Gregoriana<br>Piazza della Pilotta, 4 - 00187 Roma (Italia)");
	else
	{ alert("Funz. scrivi_footer() - errore lingua"); return false; }
	
	return true;
}











/*	--------------- SEZIONE PERSONALIZZAZIONI PER TUTTO IL SITO -------------------------	*/










/*	++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++	*/

/*    ------------------------------------------------------------	*/
/*		Funzioni per la modifica dinamica del menu orizzontale		*/
/*    ------------------------------------------------------------	*/

/*	Versione 09/09/2008	*/

function DOM01 (lang) {
	var el;
	
/*	Modifica delle caratteristiche della dimensione del div#navigation_or3 in funzione della lingua	*/
	
	el = document.getElementById("navigation_or3");
	if (lang == "sp")
	{	if (dim_finestra == "low") el.style.width = "60px";
		else
		if (dim_finestra == "high") el.style.width = "125px";
	}
	
/*	Modifica delle caratteristiche della dimensione del div#search_campo in funzione della lingua	*/
	
	el = document.getElementById("search_campo");
	if (lang == "sp")
	{	if (dim_finestra == "low") el.style.width = "1px";
		else
		if (dim_finestra == "high") el.style.width = "30px";
	}
	
	return true;
}

/*	+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++	*/

/*	Funzione di prova per cercare di "détecter" se on se trouve en "print" ou non	*/
/*	01-10-08: résultat négatif											*/
/*	Script chiamato da zz1_template\template_1/index.html				*/

function DOMxx (lang) {

	var el, xx;
	var css = new Array();
	
/*	-----------------------------------------------------------	*/

	rule = "test";
	tipo_browser = get_browser();
	if (tipo_browser == "ie" || tipo_browser == "op") prop = "fontSize";		// Valido per IE e Opera
	if (tipo_browser == "mz") prop = "font-size";					// Valido per FF e Chrome
	
/*	risultato = getStyleProp(rule, prop);	*/
	
	risultato = getStyle(rule, prop);
	
	retour = tipo_browser + " - #" + rule + "." + prop + " -> " + risultato;
	
	return retour;

/*	-----------------------------------------------------------	*/
	
	css = document.getElementsByTagName("fieldset");
	dim = css.length;
	
	for (i=0; i<dim; i++)
	{
		stringa = "<p>[" + i + "] </p>";
		document.write(stringa);
	}
	
	return dim;
	
/*	-----------------------------------------------------------	*/

/*	Ritrova tutti file css, purttroppo anche quelli non usati	*/
/*																*/
/*	Selezionado a mano il file "library.css", lo script 		*/
/*	ritrova la dichiarazione: p.zxc { color: black; }			*/
/*	In output il colre (black)									*/

/*	NB: poiché non si riesca a sapere se il file library_print.css	*/
/*	è stato caricato o no, lo script non serve a nulla			*/

/*	NB: utilizza un espressione IE only: document.styleSheets[index].rules[0];	*/
/*	NB: l'alternativa con FF: document.styleSheets[index].cssRules[0]; non mi ha funzionato	*/

	css = document.styleSheets;
	dim = css.length;
	
	for (i=0; i<dim; i++)
	{	href = document.styleSheets[i].href;
		disabled = document.styleSheets[i].disabled;
		cursor = href.lastIndexOf("library.css");
		stringa = "<p>[" + i + "] cursor = " + cursor + " - href = " + href + " - Disabled = " + disabled + "</p>";
		document.write(stringa);
		if (cursor > 0) { index = i; }
	}
	
	first_rule = document.styleSheets[index].rules[0];	/*	IE only !	*/
	prima_parte = first_rule.selectorText;
	colore = first_rule.style.color;
	
	stringa = "<p>Prima parte = " + prima_parte + " - Colore = " + colore + "</p>";
	document.write(stringa);
	
	return colore;
	
/*	-----------------------------------------------------------	*/
	
	
	el = document.getElementById("test1");
	xx = el.style.margin;
	alert("test1 - el = " + el + " - Valore 'margin' = " + xx);
	
	el = document.getElementById("test2");
	xx = el.style.margin;
	alert("test2 - el = " + el + " - Valore 'margin' = " + xx);
	
	return 0;
}

/*    ------------------------------------------------------------	*/

function getStyle(el,styleProp)
{
	var x = document.getElementById(el);
	if (x.currentStyle)
		var y = x.currentStyle[styleProp];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	return y;
}

function getStyleProp(x,prop){
if(x.currentStyle)
    return(x.currentStyle[prop]);
if(document.defaultView.getComputedStyle)
    return(document.defaultView.getComputedStyle(x,'')[prop]);
return(null);
}

/*	+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++	*/





/*	Versione 09/09/2008						*/

function DOM02 (lang) {
	var el;
	
/*	Modifica delle caratteristiche della dimensione / margin-left del div#navigation_or2	*/ 
/*	in funzione della lingua											*/
	
	el = document.getElementById("navigation_or2");
	
	if (lang == "en")
	{	if (dim_finestra == "low")   el.style.width = "500px";		/* - 47px	*/
		else
		if (dim_finestra == "large") el.style.marginLeft = "30px";
		else
		if (dim_finestra == "xl")    el.style.marginLeft = "0px";
	}
	
	if (lang == "sp")
	{	 
		if (dim_finestra == "__low")
		{	alert ("ELEMENT 'menu_interno_a' = ......");
			el2 = document.getElementById("menu_interno_a");
			alert ("ELEMENT 'menu_interno_a' = " + el2);
			el2.style.fontSize = "8px";		/* 10px --> 8px	*/
		}
		else
		if (dim_finestra == "low")
		{	el.style.width = "640px";
			el.style.marginLeft = "0px";
		}
		else
		if (dim_finestra == "high") el.style.width = "755px";
		else
		if (dim_finestra == "large") 
		{	el.style.width = "842px";		/* + 100px	*/
			el.style.marginLeft = "30px";
		}
		else
		if (dim_finestra == "xl") 
		{	el.style.width = "872px";		/* + 120px	*/
			el.style.marginLeft = "20px";
		}		
		else
		if (dim_finestra == "vl") 
		{	el.style.width = "960px";		/* + 150px	*/
			el.style.marginLeft = "20px";
		}
	}
	
	return true;
}

/*	++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++	*/

/*    ---------------------------------------------------------------------			*/
/*		Funzioni scrivi_CD_......													*/
/*    ---------------------------------------------------------------------			*/

/*	In input: 	riga: riga del box da non visualizzare								*/
/*					se vale 0 si visualizzano tutte le righe						*/
/*				lang: attualmente le lingue supportate sono: it, en, sp				*/
/*				img: l'immagine facoltativa da inserire nel box, dopo il titolo		*/
/*				altezza: altezza dell'immagine (facoltativa)						*/
/*				alt_img: il testo alternativo all'immagine (facoltativo)			*/


/*	-------------------------------------------------------------------------------------	*/

/*	Funzione scrivi_cd_gregoriana (riga_da_saltare, lang, img, altezza, alt_img)			*/

/*	Versione del 07/01/2010																	*/

function scrivi_cd_gregoriana (riga_da_saltare, lang, img, altezza, alt_img) {
	var dim, alt1, titolo;
	var label  = new Array();
	var dest   = new Array();
	var lingua = new Array();
	var ext    = new Array();
	var target = new Array();
	var alt2   = new Array();
	
	dim = 10;	/* Numero di righe del box	*/

	if (riga_da_saltare < 0 || riga_da_saltare > dim)
	{	alert("Funz. scrivi_cd_benvenuto() - riga da saltare= '" + riga_da_saltare + "' invalida.");
		return false
	}
	
	if (lang != "it" && lang != "en" && lang != "fr" && lang != "sp" && lang != "pt" && lang != "de")
	{	alert("Funz. scrivi_cd_benvenuto() - lingua: '" + lang + "' invalida.");
		return false
	}
	
/*	Personalizzazione indipendente della lingua	*/

	dest[0] = "";		
	dest[1] = "Univ/su/dichiarazione_intenti_";
	dest[2] = "Univ/su/statuta_";
	dest[3] = "Univ/su/regolamento_";
	dest[4] = "Univ/su/norme_";
	dest[5] = "Univ/su/ordo_";
	dest[6] = "Univ/su/programmi_degli_studi_";
	dest[7] = "Univ/materiale/PUG_inaugurazione_";
	dest[8] = "Univ/su/liber_annualis_";
	dest[9] = "Univ/su/processo_bologna_";
	dest[10] = "Univ/su/virtus_et_scientia_";

	
	ext[0] = "";		
	ext[1] = "php";
	ext[2] = "php";
	ext[3] = "php";
	ext[4] = "php";
	ext[5] = "php";
	ext[6] = "php";
	ext[7] = "php";
	ext[8] = "php";
	ext[9] = "php";
	ext[10] = "php";

	target[0] = "";		
	target[1] = "_self";
	target[2] = "_self";
	target[3] = "_self";
	target[4] = "_self";
	target[5] = "_self";
	target[6] = "_self";
	target[7] = "_self";
	target[8] = "_self";
	target[9] = "_self";
	target[10] = "_self";

/*	Personalizzazione dipendente della lingua	*/

	if (lang == "it")
	{	titolo = "La Gregoriana";
		alt1   = "Segue un testo cliccabile";
		
		label[0] = "";	
		label[1] = "Dichiarazione d&#039;intenti";
		label[2] = "<em>Statuta</em>";
		label[3] = "Regolamento";
		label[4] = "Norme";
		label[5] = "<em>Ordo anni academici</em>";
		label[6] = "Programmi degli Studi";
		label[7] = "Inaugurazione Anno Accademico";
		label[8] = "<em>Liber Annualis</em>";
		label[9] = "Processo di Bologna";
		label[10] = "Brochure <em>Virtus et scientia</em>";
		
		lingua[0] = "";
		lingua[1] = "it";
		lingua[2] = "it";
		lingua[3] = "it";
		lingua[4] = "it";
		lingua[5] = "it";
		lingua[6] = "it";
		lingua[7] = "it";
		lingua[8] = "it";
		lingua[9] = "it";
		lingua[10] = "it";
		
		alt2[0] = "";
		alt2[1] = "Per consultare la Dichiarazione d&#039;intenti";
		alt2[2] = "Per consultare le Statuta";
		alt2[3] = "Per consultare il Regolamento";
		alt2[4] = "Per consultare le Norme";
		alt2[5] = "Per consultare l&#039;<em>Ordo anni academici</em>";
		alt2[6] = "Per consultare i Programmi degli Studi";
		alt2[7] = "Per consultare la pubblicazione";
		alt2[8] = "Per consultare i Liber Annualis";
		alt2[9] = "Per consultare le informazioni relative al Processo di Bologna";
		alt2[10] = "Per consultare la brochure &#039;Virtus et scientia&#039;";
	}
	else
	if (lang == "en")
	{	titolo = "The University";
		alt1 = "Information follows";
		
		label[0] = "";	
		label[1] = "Mission Statement";
		label[2] = "<em>Statuta</em>";
		label[3] = "General Rules";
		label[4] = "Norms";
		label[5] = "<em>Ordo anni academici</em>";
		label[6] = "Academic Programs";
		label[7] = "Inaugurazione Anno Accademico";
		label[8] = "<em>Liber Annualis</em>";
		label[9] = "Bologna Process";
		label[10] = "<em>Virtus et scientia</em> Brochure";
		
		lingua[0] = "";
		lingua[1] = "en";
		lingua[2] = "en";
		lingua[3] = "en";
		lingua[4] = "en";
		lingua[5] = "en";
		lingua[6] = "en";
		lingua[7] = "en";
		lingua[8] = "en";
		lingua[9] = "en";
		lingua[10] = "en";
		
		alt2[0] = "";
		alt2[1] = "To consult the Mission Statement document";
		alt2[2] = "To consult the Statuta document";
		alt2[3] = "To consult the General Rules documents";
		alt2[4] = "To consult the Norms";
		alt2[5] = "To consult the Ordo anni academici</em> document";
		alt2[6] = "To consult the Academic Programs";
		alt2[7] = "To consult the document";
		alt2[8] = "To consult the Liber Annualis</em> documents";
		alt2[9] = "To consult Bologna Process information";
		alt2[10] = "To consult the &#039;Virtus et scientia&#039; brochure";
		
	}
	else
	if (lang == "sp")
	{	titolo = "La Gregoriana";
		alt1   = "Sigue un texto cliccabile";
		
		label[0] = "";	
		label[1] = "Dichiarazione d&#039;intenti";
		label[2] = "<em>Statuta</em>";
		label[3] = "Regolamento";
		label[4] = "Normas";
		label[5] = "<em>Ordo anni academici</em>";
		label[6] = "Programas de estudio";
		label[7] = "Inaugurazione Anno Accademico";
		label[8] = "<em>Liber Annualis</em>";
		label[9] = "Processo di Bologna";
		label[10] = "Brochure <em>Virtus et scientia</em>";
		
		lingua[0] = "";
		lingua[1] = "it";
		lingua[2] = "it";
		lingua[3] = "it";
		lingua[4] = "it";
		lingua[5] = "it";
		lingua[6] = "it";
		lingua[7] = "it";
		lingua[8] = "it";
		lingua[9] = "it";
		lingua[10] = "it";
		
		alt2[0] = "";
		alt2[1] = "Vaya a la página";
		alt2[2] = "Vaya a la página";
		alt2[3] = "Vaya a la página";
		alt2[4] = "Vaya a la página";
		alt2[5] = "Vaya a la página";
		alt2[6] = "Vaya a la página";
		alt2[7] = "Vaya a la página";
		alt2[8] = "Vaya a la página";
		alt2[9] = "Vaya a la página";
		alt2[10] = "Vaya a la página";
	}
	
/*	Scrittura del box CD Gregoriana	*/

	scrivi_cd_open_box(titolo);
	
	if (img != undefined) 
	{	if (altezza == undefined)
		{	alert("Funzione scrivi_cd_benvenuto() - L'altezza dell'immagine non è definita.");
			return false;
		}
		if (alt_img == undefined)
		{	alert("Funzione scrivi_cd_benvenuto() - Il testo alternativo dell'immagine non è definito.");
			return false;
		}
		scrivi_cd_img_box (img, altezza, alt_img);		/* Immagine nel box */
	}
	
	for (i=1; i<=dim; i++) 
	{	if (i != riga_da_saltare) scrivi_cd_riga_box (i, alt1, label[i], dest[i], lingua[i], ext[i], target[i], alt2[i]);
	}

	scrivi_cd_close_box();

	return true;
}

/*	-------------------------------------------------------------------------------------	*/

/*	Funzione scrivi_cd_notizie_storiche (riga_da_saltare, lang, img, altezza, alt_img)		*/

/*	Versione del 09/01/2010																	*/

function scrivi_cd_notizie_storiche (riga_da_saltare, lang, img, altezza, alt_img) {
	var dim, alt1, titolo;
	var label  = new Array();
	var dest   = new Array();
	var lingua = new Array();
	var ext    = new Array();
	var target = new Array();
	var alt2   = new Array();
	
	dim = 3;	/* Numero di righe del box	*/

	if (riga_da_saltare < 0 || riga_da_saltare > dim)
	{	alert("Funz. scrivi_cd_benvenuto() - riga da saltare= '" + riga_da_saltare + "' invalida.");
		return false
	}
	
	if (lang != "it" && lang != "en" && lang != "fr" && lang != "sp" && lang != "pt" && lang != "de")
	{	alert("Funz. scrivi_cd_benvenuto() - lingua: '" + lang + "' invalida.");
		return false
	}
	
/*	Personalizzazione indipendente della lingua	*/

	dest[0] = "";		
	dest[1] = "Univ/ns/storia_universita_";
	dest[2] = "Univ/ns/studenti_illustri_";
	dest[3] = "Univ/ns/elenco_rettori_";
	
	ext[0] = "";		
	ext[1] = "php";
	ext[2] = "php";
	ext[3] = "php";

	target[0] = "";		
	target[1] = "_self";
	target[2] = "_self";
	target[3] = "_self";

/*	Personalizzazione dipendente della lingua	*/

	if (lang == "it")
	{	titolo = "Notizie storiche";
		alt1   = "Segue un testo cliccabile";
		
		label[0] = "";	
		label[1] = "Cenni storici";
		label[2] = "Studenti illustri";
		label[3] = "Magnifici Rettori dell&#039;Università";
		
		lingua[0] = "";
		lingua[1] = "it";
		lingua[2] = "it";
		lingua[3] = "it";
		
		alt2[0] = "";
		alt2[1] = "Per consultare i cenni storici";
		alt2[2] = "Per consultare la lista degli Studenti illustri";
		alt2[3] = "Per consultare l&#039;elenco dei Magnifici Rettori";
	}
	else
	if (lang == "en")
	{	titolo = "University History";
		alt1 = "Information follows";
		
		label[0] = "";	
		label[1] = "Historical Notes";
		label[2] = "Prominent Alumni";
		label[3] = "Rectors of the University";
		
		lingua[0] = "";
		lingua[1] = "en";
		lingua[2] = "en";
		lingua[3] = "en";
		
		alt2[0] = "";
		alt2[1] = "To consult the Historical Notes";
		alt2[2] = "To consult the Prominent Alumni list";
		alt2[3] = "To consult the Rectors list";
	}
	else
	if (lang == "sp")
	{	titolo = "Notizie storiche";
		alt1   = "Sigue un texto cliccabile";
		
		label[0] = "";	
		label[1] = "Historia de la Universidad";
		label[2] = "Estudiantes ilustres";
		label[3] = "Magnifici Rettori dell&#039;Università";
		
		lingua[0] = "";
		lingua[1] = "it";
		lingua[2] = "it";
		lingua[3] = "it";
		
		alt2[0] = "";
		alt2[1] = "Vaya a la página";
		alt2[2] = "Vaya a la página";
		alt2[3] = "Vaya a la página";
	}
	
/*	Scrittura del box CD Notizie storiche	*/

	scrivi_cd_open_box(titolo);
	
	if (img != undefined) 
	{	if (altezza == undefined)
		{	alert("Funzione scrivi_cd_benvenuto() - L'altezza dell'immagine non è definita.");
			return false;
		}
		if (alt_img == undefined)
		{	alert("Funzione scrivi_cd_benvenuto() - Il testo alternativo dell'immagine non è definito.");
			return false;
		}
		scrivi_cd_img_box (img, altezza, alt_img);		/* Immagine nel box */
	}
	
	for (i=1; i<=dim; i++) 
	{	if (i != riga_da_saltare) scrivi_cd_riga_box (i, alt1, label[i], dest[i], lingua[i], ext[i], target[i], alt2[i]);
	}

	scrivi_cd_close_box();

	return true;
}

/*	-------------------------------------------------------------------------------------	*/

/*	Funzione scrivi_cd_informazioni_pratiche (riga_da_saltare, lang, img, altezza, alt_img)	*/

/*	Versione del 05/01/2010																	*/

function scrivi_cd_informazioni_pratiche (riga_da_saltare, lang, img, altezza, alt_img) {
	var dim, alt1, titolo;
	var label  = new Array();
	var dest   = new Array();
	var lingua = new Array();
	var ext    = new Array();
	var target = new Array();
	var alt2   = new Array();
	
	dim = 4;	/* Numero di righe del box	*/

	if (riga_da_saltare < 0 || riga_da_saltare > dim)
	{	alert("Funz. scrivi_cd_benvenuto() - riga da saltare= '" + riga_da_saltare + "' invalida.");
		return false
	}
	
	if (lang != "it" && lang != "en" && lang != "fr" && lang != "sp" && lang != "pt" && lang != "de")
	{	alert("Funz. scrivi_cd_benvenuto() - lingua: '" + lang + "' invalida.");
		return false
	}
	
/*	Personalizzazione indipendente della lingua	*/

	dest[0] = "";		
	dest[1] = "Univ/ip/dove_siamo_v3_";
	dest[2] = "Univ/ip/luoghi_Universita_";
	dest[3] = "Univ/ip/benvenuto_gregoriana_";
	dest[4] = "Univ/ip/siti_utili_";
	
	ext[0] = "";		
	ext[1] = "php";
	ext[2] = "php";
	ext[3] = "php";
	ext[4] = "php";

	target[0] = "";		
	target[1] = "_self";
	target[2] = "_self";
	target[3] = "_self";
	target[4] = "_self";

/*	Personalizzazione dipendente della lingua	*/

	if (lang == "it")
	{	titolo = "Informazioni pratiche";
		alt1   = "Segue un testo cliccabile";
		
		label[0] = "";	
		label[1] = "Come raggiungerci";
		label[2] = "I luoghi dell&#039;Università";
		label[3] = "Benvenuto in Gregoriana";
		label[4] = "Siti utili";
		
		lingua[0] = "";
		lingua[1] = "it";
		lingua[2] = "it";
		lingua[3] = "it";
		lingua[4] = "it";
		
		alt2[0] = "";
		alt2[1] = "Per consultare i cenni storici";
		alt2[2] = "Per consultare la lista degli Studenti illustri";
		alt2[3] = "Per consultare l&#039;elenco dei Magnifici Rettori";
		alt2[4] = "Per consultare la sitografia";
	}
	else
	if (lang == "en")
	{	titolo = "Practical Information";
		alt1 = "Information follows";
		
		label[0] = "";	
		label[1] = "How to reach us";
		label[2] = "University Places";
		label[3] = "Welcome in Gregoriana";
		label[4] = "Useful Links";
		
		lingua[0] = "";
		lingua[1] = "en";
		lingua[2] = "en";
		lingua[3] = "en";
		lingua[4] = "en";
		
		alt2[0] = "";
		alt2[1] = "To consult the Historical Notes";
		alt2[2] = "To consult the Prominent Alumni list";
		alt2[3] = "To consult the Rectors list";
		alt2[4] = "To consult the";
	}
	else
	if (lang == "sp")
	{	titolo = "Informazioni pratiche";
		alt1   = "Sigue un texto cliccabile";
		
		label[0] = "";	
		label[1] = "Ubicacion en Roma";
		label[2] = "Plano general de la Universidad";
		label[3] = "Benvenuto in Gregoriana";
		label[4] = "Siti utili";
		
		lingua[0] = "";
		lingua[1] = "it";
		lingua[2] = "it";
		lingua[3] = "it";
		lingua[4] = "it";
		
		alt2[0] = "";
		alt2[1] = "Vaya a la página";
		alt2[2] = "Vaya a la página";
		alt2[3] = "Vaya a la página";
		alt2[4] = "Vaya a la página";
	}
	
/*	Scrittura del box CD Informazioni pratiche	*/

	scrivi_cd_open_box(titolo);
	
	if (img != undefined) 
	{	if (altezza == undefined)
		{	alert("Funzione scrivi_cd_benvenuto() - L'altezza dell'immagine non è definita.");
			return false;
		}
		if (alt_img == undefined)
		{	alert("Funzione scrivi_cd_benvenuto() - Il testo alternativo dell'immagine non è definito.");
			return false;
		}
		scrivi_cd_img_box (img, altezza, alt_img);		/* Immagine nel box */
	}
	
	for (i=1; i<=dim; i++) 
	{	if (i != riga_da_saltare) scrivi_cd_riga_box (i, alt1, label[i], dest[i], lingua[i], ext[i], target[i], alt2[i]);
	}

	scrivi_cd_close_box();

	return true;
}

/*	-------------------------------------------------------------------------------------	*/

/*			+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++		*/
/*			Routine di servizio per la gestione dei box nella colonna di destra		*/
/*			+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++		*/

/*	Funzione scrivi_cd_open_box (titolo) - Versione del 0/07/2008 | 08-01-2010		*/

/*	La funzione scrive il titolo del box							*/

/*	NB: Utilizza la classe "td.cd_titolo_box", specifico dei box	*/

function scrivi_cd_open_box (titolo) {
	document.write("<table class='more_info' style='border: 1px solid rgb(124,148,172);'>");
	document.write("<tr class='testo_bl'><td class='cd_titolo_box' colspan='2'>" + titolo + "</td></tr>");
	return true;
}

/*	-------------------------------------------------------------------------------------	*/

/*	Funzione scrivi_cd_img_box (img, alt_img) - Versione del 11/07/2008			*/

/*	La funzione scrive l'immagine nel box										*/

function scrivi_cd_img_box (img, altezza, alt_img) {
	var sorgente;
	
	sorgente = gl_path + "zz1_images/cd/" + img;
	
	document.write("<tr class='testo'>");
	
	document.write("<td class='padding_no' colspan='2'>");
	
	document.write("<img class='std' src='" + sorgente + "'width='148' height='" + altezza + "' alt='" + alt_img + "' title='" + alt_img + "'>");
							
	document.write("</td></tr>");
			
	return true;
}

/*	---------------------------------------------------------------------------------------------	*/

/*	Funzione scrivi_cd_riga_box (riga, alt1, label, dest, lingua, ext, target, alt2, nome, numero)	*/

/*	Versione del 13/01/2010													*/

/*	In input:	riga: numero della riga; serve unicamente per i messaggi di errore		*/
/*			alt1: testo alt/title per la prima icona									*/
/*			label: testo																*/
/*			dest: destinazione, senza la lingua, senza l'extension						*/
/*			lingua: lingua della destinazione											*/
/*			ext: extension della destinazione											*/
/*			target { "_self", "_blank" }												*/
/*			alt2: testo alt/title per la seconda icona									*/
/*			nome: nome della seconda icona [stringa] (facoltativo)						*/
/*			numero: numero della seconda icona [stringa] (facoltativo)					*/

/*	NB: Utilizza le classi "td.cd_riga_left" e "td.cd_riga_right"						*/


function scrivi_cd_riga_box (riga, alt1, label, dest, lingua, ext, target, alt2, nome, numero) {
	var $link, destinazione, nome_icona, numero_icona, retour;
	
	$link = dest + lingua + "." + ext;
	
	destinazione = gl_path + $link;
	
	if (target != "_self" && target != "_blank")
	{	alert("Errore generazione box CD nella riga " + riga + " a causa del parametro target: " + target);
		return false;
	}
	
	if (nome != undefined)
	{	nome_icona = nome;
		if (numero == undefined)
		{	alert("Errore generazione box CD nella riga " + riga + " a causa dei parametri nome/numero: " + nome + "/" + numero);
			return false;
		}
		numero_icona = numero;
	}
	
	document.write("<tr class='testo'><td class='cd_riga_left'>");
	retour = scrivi_icona ("bullet", "2", alt1);
	
	$pagina_web = fichier();
	$link = find_fichier($link);
	
/*	Versione old con icona dopo il testo	*/
/*	------------------------------------	*/

/*	nome_icona   = "forward";	*/
/*	numero_icona = "3";	*/
/*	document.write("</td><td class='cd_riga_right'>" + label + "<span class='link_pagina'><a href='" + destinazione + "' target='" + target + "'>"); */
/*	retour = scrivi_icona (nome_icona, numero_icona, alt2); */
/*	document.write("</a></td></tr>");	*/
	
/*	Versione con testo cliccabile	*/
/*	-----------------------------	*/

	document.write("</td><td class='cd_riga_right'>");
	
	if ($link != $pagina_web)
	{	document.write("<span class='cd_link_pagina'>");
		document.write("<a href='" + destinazione + "' target='" + target + "' title='" + alt2 + "'>" + label + "</a>");
	}
	else
		document.write("<span class='cd_link_activelink'>" + label);
	
	document.write("</span></td></tr>");

	return true;
}

/*	-------------------------------------------------------------------------------------	*/

/*	Funzione scrivi_cd_close_box () - Versione del 03/07/2008						*/


function scrivi_cd_close_box () {
	document.write("</table>");
	return true;
}

/*	---------------------------------------	*/

/*	Funzione servizio_10 (lang)			*/

function servizio_10 (lang) {
	
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
var pageTracker = _gat._getTracker("UA-8846198-1");
pageTracker._trackPageview();
} catch(err) {}

	return true;
}

/*	-------------------------------------------------------------------------------------	*/

/*    --------------------------------------------------------	*/
/*	Funzione per la scrittura della richiesta del consenso		*/
/*    --------------------------------------------------------	*/

/*	scrivi_consenso () - Versione del 27/11/2009				*/

function scrivi_informativa_privacy (lang, classe) {

	if (classe == "") classe = "testo";
	document.write("<span class='" + classe + "'>Come da <a href='" + gl_path + "sito/sito_2/informativa_privacy_" + lang + ".php'>informativa sulla privacy</a>, l'interessato dà il suo consenso al trattamento dei propri dati ai sensi dell'art.13 del D.Lgs.196/03.</span>");
	
	return true;
}

/*	------------------------------------------------------------------------------		*/

/*	Funzione scrivi_logo_top_uv (lang)						*/

/*	Versione del 08/06/2009 - 26/09/2009					*/

/*	Questa funzione serve per caricare il banner "top" in funzione della variabile $ud	*/

/*	In input: $lang [stringa], $ud [numerico] (codice dell'Ufficio Virtuale)			*/

function scrivi_logo_top_uv ($lang, $ud)  {
	
	$dir_banner = "zz1_banner/";
	$dir = "";
	
	switch ($ud)
	{	case -1:	$dir = "standard/";
					break;
						
		case 1:		$dir = "filosofia/";
					break;
					
		case 2:		$dir = "teologia/";
					break;
					
		case 3:		$dir = "dc/";
					break;
					
		case 15:	$dir = "storia/";
					break;
					
		case 5:		$dir = "missiologia/";
					break;
					
		case 6:		$dir = "ss/";
					break;
					
		case 7:		$dir = "spiritualita/";
					break;
					
		case 9:		$dir = "psicologia/";
					break;
					
		case 13:	$dir = "ISIRC/";
					break;
					
		case 10:	$dir = "CICS/";
					break;
					
		case 12:	$dir = "CIFS/";
					break;
					
		case 17:	$dir = "laikos/";
					break;
						
		default:	alert("scrivi_logo_top_uv() - UD invalido = '" + $ud + "' ");
					$dir = "standard/";
	}
	
	$dir_banner = $dir_banner + $dir;
	retour = scrivi_logo_top_core($lang, $dir_banner);

	return 0;
}

/*	------------------------------------------------------------------------------	*/

