theDeep	= 0;
theSel	= "";
theSelMenu = -1;
theLanguage = "ita";
theLanButton = "uk";
thePref = "";
theLangTarget = "";

function InitMenus(deep, sel) {
	theDeep = deep;
	theSel = sel;
	
	var hrf = window.location.href;
	
	if (theDeep == 0) {
		if (hrf.substring(hrf.length-8, hrf.length-4) == "eng") {
			theLanguage = "eng";
			theLangTarget = "#";
		} else {
			theLangTarget = "#";
		}
	} else {
				var lpos = hrf.indexOf("/eng/");
		if (hrf.indexOf("/eng") >= 0) {
			theLanguage = "eng";
			theLangTarget = "#";
		} else {
			lpos = hrf.indexOf("/ita/");
			theLangTarget = "#";
		}
	}
	
	if (theLanguage == "eng") theLanButton = "it";
	
	for (var i=0; i<deep; i++) thePref = thePref + "../";

//SEZIONE 1 - Elenco delle voci per ogni singolo menu. Bisogna specificare qui quali sono le voci che compongono ogni singolo menu
	if	(sel == 'storia01' || sel == 'storia02' || sel == 'storia03' || sel == 'storia04' || sel == 'storia05' || sel == 'storia06' || sel == 'storia07' || sel == 'storia08') theSelMenu = 0;
	else if (sel == 'restauri01' || sel == 'restauri02' || sel == 'restauri03' || sel == 'restauri04' || sel == 'restauri05' || sel == 'restauri06' || sel == 'restauri07' || sel == 'restauri08' || sel == 'restauri09' || sel == 'restauri10' || sel == 'restauri11' || sel == 'restauri12' || sel == 'restauri13')  theSelMenu = 1;
	else if (sel == 'attivita01'   || sel == 'attivita02'   || sel == 'attivita03'   || sel == 'attivita04') theSelMenu = 2;
	else if (sel == 'info01'   || sel == 'info02'   || sel == 'info03'   || sel == 'info04'   || sel == 'info05'   || sel == 'info06'   || sel == 'info07') theSelMenu = 3;
	
//SEZIONE 2 -  Definizione di ogni voce di menu (con relativa immagine). Qui si definisce l'immagine (e il suo corrispetivo stato di hover) da associare alla voce di menu 
	if (sel != "storia01")		CSInit[CSInit.length] = new Array(CSILoad,"storia01",	thePref + theLanguage + "/imcom"  + "/menu_storia/storia01_n.gif",		thePref + theLanguage + "/imcom"  + "/menu_storia/storia01_h.gif",		"","");
	if (sel != "storia02")		CSInit[CSInit.length] = new Array(CSILoad,"storia02",	thePref + theLanguage + "/imcom"  + "/menu_storia/storia02_n.gif",		thePref + theLanguage + "/imcom"  + "/menu_storia/storia02_h.gif",		"","");
	if (sel != "storia03")		CSInit[CSInit.length] = new Array(CSILoad,"storia03",	thePref + theLanguage + "/imcom"  + "/menu_storia/storia03_n.gif",		thePref + theLanguage + "/imcom"  + "/menu_storia/storia03_h.gif",		"","");
	if (sel != "storia04")		CSInit[CSInit.length] = new Array(CSILoad,"storia04",	thePref + theLanguage + "/imcom"  + "/menu_storia/storia04_n.gif",		thePref + theLanguage + "/imcom"  + "/menu_storia/storia04_h.gif",		"","");
	if (sel != "storia05")		CSInit[CSInit.length] = new Array(CSILoad,"storia05",	thePref + theLanguage + "/imcom"  + "/menu_storia/storia05_n.gif",		thePref + theLanguage + "/imcom"  + "/menu_storia/storia05_h.gif",		"","");
	if (sel != "storia06")		CSInit[CSInit.length] = new Array(CSILoad,"storia06",	thePref + theLanguage + "/imcom"  + "/menu_storia/storia06_n.gif",		thePref + theLanguage + "/imcom"  + "/menu_storia/storia06_h.gif",		"","");


	if (sel != "restauri01")	CSInit[CSInit.length] = new Array(CSILoad,"restauri01",	thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri01_n.gif",	thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri01_h.gif",	"","");
	if (sel != "restauri02")	CSInit[CSInit.length] = new Array(CSILoad,"restauri02",	thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri02_n.gif",	thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri02_h.gif",	"","");
	if (sel != "restauri03")	CSInit[CSInit.length] = new Array(CSILoad,"restauri03",	thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri03_n.gif",	thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri03_h.gif",	"","");


	if (sel != "attivita01")	CSInit[CSInit.length] = new Array(CSILoad,"attivita01",	thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita01_n.gif",	thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita01_h.gif",	"","");
	if (sel != "attivita02")	CSInit[CSInit.length] = new Array(CSILoad,"attivita02",	thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita03_n.gif",	thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita03_h.gif",	"","");
	if (sel != "attivita03")	CSInit[CSInit.length] = new Array(CSILoad,"attivita03",	thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita04_n.gif",	thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita04_h.gif",	"","");
	if (sel != "attivita04")	CSInit[CSInit.length] = new Array(CSILoad,"attivita04",	thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita06_n.gif",	thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita06_h.gif",	"","");


	if (sel != "info01")		CSInit[CSInit.length] = new Array(CSILoad,"info01",	thePref + theLanguage + "/imcom"  + "/menu_info/info01_n.gif",		thePref + theLanguage + "/imcom"  + "/menu_info/info01_h.gif",		"","");
	if (sel != "info02")		CSInit[CSInit.length] = new Array(CSILoad,"info02",	thePref + theLanguage + "/imcom"  + "/menu_info/info02_n.gif",		thePref + theLanguage + "/imcom"  + "/menu_info/info02_h.gif",		"","");
	if (sel != "info03")		CSInit[CSInit.length] = new Array(CSILoad,"info03",	thePref + theLanguage + "/imcom"  + "/menu_info/info03_n.gif",		thePref + theLanguage + "/imcom"  + "/menu_info/info03_h.gif",		"","");
	if (sel != "info04")		CSInit[CSInit.length] = new Array(CSILoad,"info04",	thePref + theLanguage + "/imcom"  + "/menu_info/info04_n.gif",		thePref + theLanguage + "/imcom"  + "/menu_info/info04_h.gif",		"","");
	if (sel != "info05")		CSInit[CSInit.length] = new Array(CSILoad,"info05",	thePref + theLanguage + "/imcom"  + "/menu_info/info05_n.gif",		thePref + theLanguage + "/imcom"  + "/menu_info/info05_h.gif",		"","");
	if (sel != "info06")		CSInit[CSInit.length] = new Array(CSILoad,"info06",	thePref + theLanguage + "/imcom"  + "/menu_info/info06_n.gif",		thePref + theLanguage + "/imcom"  + "/menu_info/info06_h.gif",		"","");
	if (sel != "info08")		CSInit[CSInit.length] = new Array(CSILoad,"info08",	thePref + theLanguage + "/imcom"  + "/menu_info/info08_n.gif",		thePref + theLanguage + "/imcom"  + "/menu_info/info08_h.gif",		"","");
	if (sel != "info09")		CSInit[CSInit.length] = new Array(CSILoad,"info09",	thePref + theLanguage + "/imcom"  + "/menu_info/info10_n.gif",		thePref + theLanguage + "/imcom"  + "/menu_info/info10_h.gif",		"","");
	if (sel != "info10")		CSInit[CSInit.length] = new Array(CSILoad,"info10",	thePref + theLanguage + "/imcom"  + "/menu_info/info09_n.gif",		thePref + theLanguage + "/imcom"  + "/menu_info/info09_h.gif",		"","");


	if (theSelMenu == 0)		CSInit[CSInit.length] = new Array(CSILoad,"mnstoria",	thePref + theLanguage + "/imcom"  + "/storia_s.gif",	thePref + theLanguage + "/imcom"  + "/storia_s_h.gif",	"","");
	else										CSInit[CSInit.length] = new Array(CSILoad,"mnstoria",	thePref + theLanguage + "/imcom"  + "/storia_n.gif",	thePref + theLanguage + "/imcom"  + "/storia_h.gif",		"","");
	if (theSelMenu == 1)		CSInit[CSInit.length] = new Array(CSILoad,"mnrestauri",	thePref + theLanguage + "/imcom"  + "/restauri_s.gif",	thePref + theLanguage + "/imcom"  + "/restauri_s_h.gif",	"","");
	else										CSInit[CSInit.length] = new Array(CSILoad,"mnrestauri",	thePref + theLanguage + "/imcom"  + "/restauri_n.gif",	thePref + theLanguage + "/imcom"  + "/restauri_h.gif",		"","");
	if (theSelMenu == 2)		CSInit[CSInit.length] = new Array(CSILoad,"mnattivita",		thePref + theLanguage + "/imcom"  + "/attivita_s.gif",		thePref + theLanguage + "/imcom"  + "/attivita_s_h.gif",		"","");
	else										CSInit[CSInit.length] = new Array(CSILoad,"mnattivita",		thePref + theLanguage + "/imcom"  + "/attivita_n.gif",		thePref + theLanguage + "/imcom"  + "/attivita_h.gif",			"","");
	if (theSelMenu == 3)		CSInit[CSInit.length] = new Array(CSILoad,"mninfo",		thePref + theLanguage + "/imcom"  + "/info_s.gif",		thePref + theLanguage + "/imcom"  + "/info_s_h.gif",		"","");
	else										CSInit[CSInit.length] = new Array(CSILoad,"mninfo",		thePref + theLanguage + "/imcom"  + "/info_n.gif",		thePref + theLanguage + "/imcom"  + "/info_h.gif",			"","");
													CSInit[CSInit.length] = new Array(CSILoad,"mnflag",		thePref + theLanguage + "/imcom"  + "/" + theLanButton + "_n.gif",			thePref + theLanguage + "/imcom"  + "/" + theLanButton + "_h.gif",			"","");

	CSAct[ 'storiaOn']	= new Array(CSShowHide, 'storia',	1);
	CSAct[ 'storiaOff']	= new Array(CSShowHide, 'storia',	0);

	CSAct[ 'restauriOn']	= new Array(CSShowHide, 'restauri',	1);
	CSAct[ 'restauriOff']	= new Array(CSShowHide, 'restauri',	0);

	CSAct[ 'attivitaOn']		= new Array(CSShowHide, 'attivita',		1);
	CSAct[ 'attivitaOff']		= new Array(CSShowHide, 'attivita',		0);

	CSAct[ 'infoOn']		= new Array(CSShowHide, 'info',		1);
	CSAct[ 'infoOff']		= new Array(CSShowHide, 'info',		0);
}

function closeAllMenus() {
	CSAction(new Array('storiaOff', 'restauriOff', 'attivitaOff', 'infoOff'));
	menuOpen = false;
}

function openStoriaMenu() {
	if (typeof(onOpenMainMenu) != "undefined") onOpenMainMenu();
	CSAction(new Array('storiaOn', 'restauriOff', 'attivitaOff', 'infoOff'));
	menuOpen = true;
}

function openrestauriMenu() {
	if (typeof(onOpenMainMenu) != "undefined") onOpenMainMenu();
	CSAction(new Array('storiaOff', 'restauriOn', 'attivitaOff', 'infoOff'));
	menuOpen = true;
}

function openattivitaMenu() {
	if (typeof(onOpenMainMenu) != "undefined") onOpenMainMenu();
	CSAction(new Array('storiaOff', 'restauriOff', 'attivitaOn', 'infoOff'));
	menuOpen = true;
}

function openInfoMenu() {
	if (typeof(onOpenMainMenu) != "undefined") onOpenMainMenu();
	CSAction(new Array('storiaOff', 'restauriOff', 'attivitaOff', 'infoOn'));
	menuOpen = true;
}

function positionLayers() {
	aggancia("mnstoria",  "storia", 2, (IsIEMac()?30:0)+23);
	aggancia("mnrestauri",  "restauri", 2, (IsIEMac()?30:0)+23);
	aggancia("mnattivita",    "attivita",   2, (IsIEMac()?30:0)+23);
	aggancia("mninfo",    "info",   2, (IsIEMac()?30:0)+23);
}

function writeMenus() {

//SEZIONE 3 - Creazione delle voci di menu (con relativi stati) e link 

//SEZIONE 3.1 - STORIA
	document.writeln("<div id=\"storia\">");
	document.writeln("<table  border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"201\" height=\"95\"><tr>"); //verificare l'altezza
	if (theSel != 'storia01')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/vicende/index.htm\" onmouseover=\"return CSIShow(\'storia01\',1)\" onmouseout=\"return CSIShow(\'storia01\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia01_n.gif\" width=\"201\" height=\"17\" name=\"storia01\" ID=\"storia01\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/vicende/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia01_s.gif\" width=\"201\" height=\"17\" name=\"storia01\" ID=\"storia01\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'storia02')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/palazzo/index.htm\" onmouseover=\"return CSIShow(\'storia02\',1)\" onmouseout=\"return CSIShow(\'storia02\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia02_n.gif\" width=\"201\" height=\"17\" name=\"storia02\" ID=\"storia02\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/palazzo/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia02_s.gif\" width=\"201\" height=\"17\" name=\"storia02\" ID=\"storia02\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'storia03')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/parco/index.htm\" onmouseover=\"return CSIShow(\'storia03\',1)\" onmouseout=\"return CSIShow(\'storia03\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia03_n.gif\" width=\"201\" height=\"17\" name=\"storia03\" ID=\"storia03\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/parco/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia03_s.gif\" width=\"201\" height=\"17\" name=\"storia03\" ID=\"storia03\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'storia04')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/citta/index.htm\" onmouseover=\"return CSIShow(\'storia04\',1)\" onmouseout=\"return CSIShow(\'storia04\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia04_n.gif\" width=\"201\" height=\"17\" name=\"storia04\" ID=\"storia04\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/citta/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia04_s.gif\" width=\"201\" height=\"17\" name=\"storia04\" ID=\"storia04\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'storia05')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/vita_corte/index.htm\" onmouseover=\"return CSIShow(\'storia05\',1)\" onmouseout=\"return CSIShow(\'storia05\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia05_n.gif\" width=\"201\" height=\"17\" name=\"storia05\" ID=\"storia05\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/vita_corte/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia05_s.gif\" width=\"201\" height=\"17\" name=\"storia05\" ID=\"storia05\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'storia06')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/margaria/index.htm\" onmouseover=\"return CSIShow(\'storia06\',1)\" onmouseout=\"return CSIShow(\'storia06\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia06_n.gif\" width=\"201\" height=\"17\" name=\"storia06\" ID=\"storia06\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/margaria/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia06_s.gif\" width=\"201\" height=\"17\" name=\"storia06\" ID=\"storia06\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");

	document.writeln("</tr></table></div>");
		
//SEZIONE 3.2 - RESTAURI
	document.writeln("<div id=\"restauri\">");
	document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"201\" height=\"50\"><tr>");

	if (theSel != 'restauri01')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/restauri/reggia_moderna.htm\" onmouseover=\"return CSIShow(\'restauri01\',1)\" onmouseout=\"return CSIShow(\'restauri01\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri01_n.gif\" width=\"201\" height=\"17\" name=\"restauri01\" ID=\"restauri01\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/restauri/reggia_moderna.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri01_s.gif\" width=\"201\" height=\"17\" name=\"restauri01\" ID=\"restauri01\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'restauri02')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/restauri/giovani.htm\" onmouseover=\"return CSIShow(\'restauri02\',1)\" onmouseout=\"return CSIShow(\'restauri02\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri02_n.gif\" width=\"201\" height=\"17\" name=\"restauri02\" ID=\"restauri02\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/restauri/giovani.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri02_s.gif\" width=\"201\" height=\"17\" name=\"restauri02\" ID=\"restauri02\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'restauri03')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/restauri/cantiere_aperto.htm\" onmouseover=\"return CSIShow(\'restauri03\',1)\" onmouseout=\"return CSIShow(\'restauri03\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri03_n.gif\" width=\"201\" height=\"17\" name=\"restauri03\" ID=\"restauri03\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/restauri/cantiere_aperto.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri03_s.gif\" width=\"201\" height=\"17\" name=\"restauri03\" ID=\"restauri03\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	document.writeln("</tr></table></div>");

//SEZIONE 3.3 - ATTIVITA'
	document.writeln("<div id=\"attivita\">");
	document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"201\" height=\"68\"><tr>");
	if (theSel != 'attivita01')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/attivita/iniziative/index.htm\" onmouseover=\"return CSIShow(\'attivita01\',1)\" onmouseout=\"return CSIShow(\'attivita01\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita01_n.gif\" width=\"201\" height=\"17\" name=\"attivita01\" ID=\"attivita01\" border=\"0\"></a></td>");
	else					document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/attivita/iniziative/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita01_s.gif\" width=\"201\" height=\"17\" name=\"attivita01\" ID=\"attivita01\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'attivita02')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/attivita/piccoli/index.htm\" onmouseover=\"return CSIShow(\'attivita02\',1)\" onmouseout=\"return CSIShow(\'attivita02\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita03_n.gif\" width=\"201\" height=\"17\" name=\"attivita02\" ID=\"attivita02\" border=\"0\"></a></td>");
	else					document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/attivita/piccoli/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita03_s.gif\" width=\"201\" height=\"17\" name=\"attivita02\" ID=\"attivita02\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'attivita03')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/attivita/curiosita/accadde/index.htm\" onmouseover=\"return CSIShow(\'attivita03\',1)\" onmouseout=\"return CSIShow(\'attivita03\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita04_n.gif\" width=\"201\" height=\"17\" name=\"attivita03\" ID=\"attivita03\" border=\"0\"></a></td>");
	else					document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/attivita/curiosita/accadde/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita04_s.gif\" width=\"201\" height=\"17\" name=\"attivita03\" ID=\"attivita03\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'attivita04')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/attivita/index.htm\" onmouseover=\"return CSIShow(\'attivita04\',1)\" onmouseout=\"return CSIShow(\'attivita04\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita06_n.gif\" width=\"201\" height=\"17\" name=\"attivita04\" ID=\"attivita04\" border=\"0\"></a></td>");
	else					document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/attivita/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita06_s.gif\" width=\"201\" height=\"17\" name=\"attivita04\" ID=\"attivita04\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");

	document.writeln("</tr></table></div>");

//SEZIONE 3.4 - INFO
	document.writeln("<div id=\"info\">");
	document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"94\" height=\"50\"><tr>");
	if (theSel != 'info01')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/info/comearrivare.htm\" onmouseover=\"return CSIShow(\'info01\',1)\" onmouseout=\"return CSIShow(\'info01\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info01_n.gif\" width=\"94\" height=\"17\" name=\"info01\" ID=\"info01\" border=\"0\"></a></td>");
	else										document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/info/comearrivare.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info01_s.gif\" width=\"94\" height=\"17\" name=\"info01\" ID=\"info01\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'info02')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/info/ingresso.htm\" onmouseover=\"return CSIShow(\'info02\',1)\" onmouseout=\"return CSIShow(\'info02\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info02_n.gif\" width=\"94\" height=\"17\" name=\"info02\" ID=\"info02\" border=\"0\"></a></td>");
	else										document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/info/ingresso.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info02_s.gif\" width=\"94\" height=\"17\" name=\"info02\" ID=\"info02\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'info03')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/info/servizi.htm\" onmouseover=\"return CSIShow(\'info03\',1)\" onmouseout=\"return CSIShow(\'info03\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info03_n.gif\" width=\"94\" height=\"17\" name=\"info03\" ID=\"info03\" border=\"0\"></a></td>");
	else										document.writeln("<td valign=\"top\" align=\"left\"><a href=\"#\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info03_s.gif\" width=\"94\" height=\"17\" name=\"info03\" ID=\"info03\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'info04')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/info/comunicati/index.htm\" onmouseover=\"return CSIShow(\'info04\',1)\" onmouseout=\"return CSIShow(\'info04\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info04_n.gif\" width=\"94\" height=\"17\" name=\"info04\" ID=\"info04\" border=\"0\"></a></td>");
	else										document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/info/comunicati/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info04_s.gif\" width=\"94\" height=\"17\" name=\"info04\" ID=\"info04\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'info05')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"javascript:popup('" + thePref + theLanguage + "/info/contatti.htm', '_blank', 440, 300);\" onmouseover=\"return CSIShow(\'info05\',1)\" onmouseout=\"return CSIShow(\'info05\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info05_n.gif\" width=\"94\" height=\"17\" name=\"info05\" ID=\"info05\" border=\"0\"></a></td>");
	else										document.writeln("<td valign=\"top\" align=\"left\"><a href=\"#\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info05_s.gif\" width=\"94\" height=\"17\" name=\"info05\" ID=\"info05\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'info06')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"javascript:popupTxt('" + thePref + theLanguage + "/info/crediti.htm', '_blank', 458, 440);\"  onmouseover=\"return CSIShow(\'info06\',1)\" onmouseout=\"return CSIShow(\'info06\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info06_n.gif\" width=\"94\" height=\"17\" name=\"info06\" ID=\"info06\" border=\"0\"></a></td>");
	else										document.writeln("<td valign=\"top\" align=\"left\"><a href=\"#\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info06_s.gif\" width=\"94\" height=\"17\" name=\"info06\" ID=\"info06\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'info08')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/info/prenotazioni.htm\"  onmouseover=\"return CSIShow(\'info08\',1)\" onmouseout=\"return CSIShow(\'info08\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info08_n.gif\" width=\"94\" height=\"17\" name=\"info08\" ID=\"info08\" border=\"0\"></a></td>");
	else										document.writeln("<td valign=\"top\" align=\"left\"><a href=\"#\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info08_s.gif\" width=\"94\" height=\"17\" name=\"info08\" ID=\"info08\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'info09')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/info/ospitalita.htm\"  onmouseover=\"return CSIShow(\'info09\',1)\" onmouseout=\"return CSIShow(\'info09\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info10_n.gif\" width=\"94\" height=\"17\" name=\"info09\" ID=\"info09\" border=\"0\"></a></td>");
	else										document.writeln("<td valign=\"top\" align=\"left\"><a href=\"#\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info10_s.gif\" width=\"94\" height=\"17\" name=\"info09\" ID=\"info09\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'info10')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/info/shop.htm\"  onmouseover=\"return CSIShow(\'info10\',1)\" onmouseout=\"return CSIShow(\'info10\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info09_n.gif\" width=\"94\" height=\"17\" name=\"info10\" ID=\"info10\" border=\"0\"></a></td>");
	else										document.writeln("<td valign=\"top\" align=\"left\"><a href=\"#\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info09_s.gif\" width=\"94\" height=\"17\" name=\"info10\" ID=\"info10\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	document.writeln("</tr></table></div>");
}

function writeHeader() {
	var stImg = "storia_n.gif";
	var viImg = "restauri_n.gif";
	var arImg = "attivita_n.gif";
	var inImg = "info_n.gif";
	
	if (theSelMenu == 0) stImg = "storia_s.gif";
	if (theSelMenu == 1) viImg = "restauri_s.gif";
	if (theSelMenu == 2) anImg = "attivita_s.gif";
	if (theSelMenu == 3) anImg = "info_s.gif";

	if (theDeep == 0)	document.writeln("<tr><td height=\"50\"><img height=\"50\" width=\"720\" src=\"" + thePref + "imcom/banner.jpg\" border=\"0\"></td>");
	else							document.writeln("<tr><td height=\"50\"><a href=\"" + thePref + theLanguage + "/index.htm\"><img height=\"50\" width=\"720\" src=\"" + thePref + "imcom/banner.jpg\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	document.writeln("<td><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"720\"><tr>");
	document.writeln("<td><a href=\"javascript:openStoriaMenu()\" onmouseout=\"return CSIShow(\'mnstoria\',0)\" onmouseover=\"if (menuOpen) openStoriaMenu(); return CSIShow(\'mnstoria\',1);\"><img name=\"mnstoria\" ID=\"mnstoria\" height=\"23\" width=\"205\" src=\"" + thePref + theLanguage + "/imcom"  + "/" + stImg + "\" border=\"0\"></a></td>");
	document.writeln("<td><a href=\"javascript:openrestauriMenu()\" onmouseout=\"return CSIShow(\'mnrestauri\',0)\" onmouseover=\"if (menuOpen) openrestauriMenu(); return CSIShow(\'mnrestauri\',1);\"><img name=\"mnrestauri\" ID=\"mnrestauri\" height=\"23\" width=\"205\" src=\"" + thePref + theLanguage + "/imcom"  + "/" + viImg + "\" border=\"0\"></a></td>");
	document.writeln("<td><a href=\"javascript:openattivitaMenu()\" onmouseout=\"return CSIShow(\'mnattivita\',0)\" onmouseover=\"if (menuOpen) openattivitaMenu(); return CSIShow(\'mnattivita\',1);\"><img name=\"mnattivita\" ID=\"mnattivita\" height=\"23\" width=\"205\" src=\"" + thePref + theLanguage + "/imcom"  + "/" + arImg + "\" border=\"0\"></a></td>");
	document.writeln("<td><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"105\" height=\"23\"><tr>");
	document.writeln("<td width=\"64\" height=\"23\"><a href=\"javascript: openInfoMenu()\" onmouseout=\"return CSIShow(\'mninfo\',0)\" onmouseover=\"if (menuOpen) openInfoMenu(); return CSIShow(\'mninfo\',1);\"><img name=\"mnandiam\" ID=\"mninfo\" height=\"23\" width=\"64\" src=\"" + thePref + theLanguage + "/imcom"  + "/" + inImg + "\" border=\"0\"></a></td>");
	document.writeln("<td width=\"41\" height=\"23\"><img name=\"mnflag\" ID=\"mnflag\" src=\"" + thePref + theLanguage + "/imcom"  + "/" + theLanButton + "_n.gif\" width=\"41\" height=\"23\" border=\"0\"></td>");
	document.writeln("</tr></table></td></tr></table></td></tr>");
}
