
// Studio Livio srl
// Via Segurana 16 Torino
// Tel.		+39-011-8197090
// Fax.		+39-011-8196005
// e-mail:		livio@livio.it
// internet:	http://www.livio.it


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 = "index.htm";
		} else {
			theLangTarget = "index_eng.htm";
		}
	} else {
		var lpos = hrf.indexOf("/eng/");
		if (hrf.indexOf("/eng") >= 0) {
			theLanguage = "eng";
			theLangTarget = hrf.substring(0, lpos+1) + "ita" + hrf.substring(lpos + 4,  hrf.length);
		} else {
			lpos = hrf.indexOf("/ita/");
			theLangTarget = hrf.substring(0, lpos+1) + "eng" + hrf.substring(lpos + 4,  hrf.length);
		}
	}
	
	if (theLanguage == "eng") theLanButton = "it";
	
	for (var i=0; i<deep; i++) thePref = thePref + "../";

	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 == 'attivita03' || sel == 'attivita05' || sel == 'attivita06' ) theSelMenu = 2;
	else if (sel == 'info01'   || sel == 'info02'   || sel == 'info03'   || sel == 'info04'   || sel == 'info05'   || sel == 'info06'   || sel == 'info07') theSelMenu = 3;
	
	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 != "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 != "restauri04")	CSInit[CSInit.length] = new Array(CSILoad,"restauri04",	thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri04_n.gif",	thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri04_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/attivita02_n.gif",	thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita02_h.gif",	"","");
	if (sel != "attivita03")	CSInit[CSInit.length] = new Array(CSILoad,"attivita03",	thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita03_n.gif",	thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita03_h.gif",	"","");
//	if (sel != "attivita04")	CSInit[CSInit.length] = new Array(CSILoad,"attivita04",	thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita04_n.gif",	thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita04_h.gif",	"","");
	if (sel != "attivita05")	CSInit[CSInit.length] = new Array(CSILoad,"attivita05",	thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita05_n.gif",	thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita05_h.gif",	"","");
	if (sel != "attivita06")	CSInit[CSInit.length] = new Array(CSILoad,"attivita06",	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 != "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 != "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 (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", 0, (IsIEMac()?30:0)+23);
	aggancia("mnrestauri",  "restauri", -1, (IsIEMac()?30:0)+23);
	aggancia("mnattivita",    "attivita",   -1, (IsIEMac()?30:0)+23);
	aggancia("mninfo",    "info",   -1, (IsIEMac()?30:0)+23);
}

function writeMenus() {
	document.writeln("<div id=\"storia\">");
	document.writeln("<table  border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"196\" height=\"84\" bgcolor=\"#FFFFFF\"><tr>");
	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=\"195\" height=\"20\" 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=\"195\" height=\"20\" name=\"storia01\" ID=\"storia01\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'storia03')	document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/artisti/albertoni.htm\" onmouseover=\"return CSIShow(\'storia03\',1)\" onmouseout=\"return CSIShow(\'storia03\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia03_n.gif\" width=\"195\" height=\"20\" name=\"storia03\" ID=\"storia03\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/artisti/albertoni.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia03_s.gif\" width=\"195\" height=\"20\" 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/nobili/filippo_sanmartino.htm\" onmouseover=\"return CSIShow(\'storia04\',1)\" onmouseout=\"return CSIShow(\'storia04\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia04_n.gif\" width=\"195\" height=\"20\" name=\"storia04\" ID=\"storia04\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/nobili/filippo_sanmartino.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia04_s.gif\" width=\"195\" height=\"20\" 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/cronologia/1200.htm\" onmouseover=\"return CSIShow(\'storia05\',1)\" onmouseout=\"return CSIShow(\'storia05\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia05_n.gif\" width=\"195\" height=\"20\" name=\"storia05\" ID=\"storia05\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"left\"><a href=\"" + thePref + theLanguage + "/storia/cronologia/1200.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_storia/storia05_s.gif\" width=\"195\" height=\"20\" name=\"storia05\" ID=\"storia05\" border=\"0\"></a></td>");
	document.writeln("</tr></table></div>");
		
	document.writeln("<div id=\"restauri\">");
	document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"207\" height=\"84\" bgcolor=\"white\"><tr>");
	if (theSel != 'restauri01')	document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/visita/castello/index.htm\" onmouseover=\"return CSIShow(\'restauri01\',1)\" onmouseout=\"return CSIShow(\'restauri01\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri01_n.gif\" width=\"205\" height=\"20\" name=\"restauri01\" ID=\"restauri01\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/visita/castello/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri01_s.gif\" width=\"205\" height=\"20\" name=\"restauri01\" ID=\"restauri01\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'restauri02')	document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/visita/borgo/index.htm\" onmouseover=\"return CSIShow(\'restauri02\',1)\" onmouseout=\"return CSIShow(\'restauri02\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri02_n.gif\" width=\"205\" height=\"20\" name=\"restauri02\" ID=\"restauri02\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/visita/borgo/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri02_s.gif\" width=\"205\" height=\"20\" name=\"restauri02\" ID=\"restauri01\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'restauri03')	document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/visita/chiese/index.htm\" onmouseover=\"return CSIShow(\'restauri03\',1)\" onmouseout=\"return CSIShow(\'restauri03\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri03_n.gif\" width=\"205\" height=\"20\" name=\"restauri03\" ID=\"restauri03\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/visita/chiese/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri03_s.gif\" width=\"205\" height=\"20\" name=\"restauri03\" ID=\"restauri02\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	if (theSel != 'restauri04')	document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/visita/passeggiata_parco/index.htm\" onmouseover=\"return CSIShow(\'restauri04\',1)\" onmouseout=\"return CSIShow(\'restauri04\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri04_n.gif\" width=\"205\" height=\"20\" name=\"restauri04\" ID=\"restauri04\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/visita/passeggiata_parco/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_restauri/restauri04_s.gif\" width=\"205\" height=\"20\" name=\"restauri04\" ID=\"restauri03\" border=\"0\"></a></td>");
	document.writeln("</tr></table></div>");

	document.writeln("<div id=\"attivita\">");
	document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"207\" height=\"84\" bgcolor=\"white\"><tr>");
	if (theSel != 'attivita01')	document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/attivita/restauri/jardin.htm\" onmouseover=\"return CSIShow(\'attivita01\',1)\" onmouseout=\"return CSIShow(\'attivita01\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita01_n.gif\" width=\"205\" height=\"20\" name=\"attivita01\" ID=\"attivita01\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/attivita/restauri/jardin.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita01_s.gif\" width=\"205\" height=\"20\" name=\"attivita01\" ID=\"attivita01\" border=\"0\"></a></td>");
	document.writeln("</tr>");
//	if (theSel != 'attivita02')	document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/attivita/scacchi.htm\" onmouseover=\"return CSIShow(\'attivita02\',1)\" onmouseout=\"return CSIShow(\'attivita02\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita02_n.gif\" width=\"205\" height=\"20\" name=\"attivita02\" ID=\"attivita02\" border=\"0\"></a></td>");
//	else						document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/attivita/scacchi.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita02_s.gif\" width=\"205\" height=\"20\" name=\"attivita02\" ID=\"attivita02\" border=\"0\"></a></td>");
	document.writeln("<tr>");
	if (theSel != 'attivita03')	document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/attivita/index.htm\" onmouseover=\"return CSIShow(\'attivita03\',1)\" onmouseout=\"return CSIShow(\'attivita03\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita03_n.gif\" width=\"205\" height=\"20\" name=\"attivita03\" ID=\"attivita03\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/attivita/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita03_s.gif\" width=\"205\" height=\"20\" name=\"attivita03\" ID=\"attivita03\" border=\"0\"></a></td>");
	document.writeln("</tr>");
	if (theSel != 'attivita05')	document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/attivita/grandi_eventi/index.htm\" onmouseover=\"return CSIShow(\'attivita05\',1)\" onmouseout=\"return CSIShow(\'attivita05\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita05_n.gif\" width=\"205\" height=\"20\" name=\"attivita05\" ID=\"attivita05\" border=\"0\"></a></td>");
	else						document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/attivita/grandi_eventi/index.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita05_s.gif\" width=\"205\" height=\"20\" name=\"attivita05\" ID=\"attivita05\" border=\"0\"></a></td>");
	document.writeln("</tr>");
	if (theSel != 'attivita06')	document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/attivita/eventi/archivio.htm\" onmouseover=\"return CSIShow(\'attivita06\',1)\" onmouseout=\"return CSIShow(\'attivita06\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita06_n.gif\" width=\"205\" height=\"20\" name=\"attivita06\" ID=\"attivita06\" border=\"0\"></a></td>");
	else					document.writeln("<td valign=\"top\" align=\"center\"><a href=\"" + thePref + theLanguage + "/attivita/eventi/archivio.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_attivita/attivita06_s.gif\" width=\"205\" height=\"20\" name=\"attivita06\" ID=\"attivita06\" border=\"0\"></a></td>");
	document.writeln("<tr>");
	document.writeln("</table></div>");

	document.writeln("<div id=\"info\">");
	document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"114\" height=\"105\" bgcolor=\"white\"><tr>");
	
	if (theSel != 'info01')	document.writeln("<td valign=\"top\" align=\"right\"><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=\"113\" height=\"20\" name=\"info01\" ID=\"info01\" border=\"0\"></a></td>");
	else			document.writeln("<td valign=\"top\" align=\"right\"><a href=\"" + thePref + theLanguage + "/info/comearrivare.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info01_s.gif\" width=\"113\" height=\"20\" name=\"info01\" ID=\"info01\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	
	if (theSel != 'info02')	document.writeln("<td valign=\"top\" align=\"right\"><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=\"113\" height=\"20\" name=\"info02\" ID=\"info02\" border=\"0\"></a></td>");
	else			document.writeln("<td valign=\"top\" align=\"right\"><a href=\"" + thePref + theLanguage + "/info/ingresso.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info02_s.gif\" width=\"113\" height=\"20\" name=\"info02\" ID=\"info02\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");

	if (theSel != 'info03')	document.writeln("<td valign=\"top\" align=\"right\"><a href=\"javascript:popup('" + thePref + theLanguage + "/info/contatti.htm', '_blank', 440, 240);\" onmouseover=\"return CSIShow(\'info03\',1)\" onmouseout=\"return CSIShow(\'info03\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info03_n.gif\" width=\"113\" height=\"20\" name=\"info03\" ID=\"info03\" border=\"0\"></a></td>");
	else			document.writeln("<td valign=\"top\" align=\"right\"><a href=\"#\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info03_s.gif\" width=\"113\" height=\"20\" name=\"info03\" ID=\"info03\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	
		if (theSel != 'info05')	document.writeln("<td valign=\"top\" align=\"right\"><a href=\"" + thePref + theLanguage + "/info/rassegna_stampa.htm\" onmouseover=\"return CSIShow(\'info05\',1)\" onmouseout=\"return CSIShow(\'info05\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info05_n.gif\" width=\"113\" height=\"20\" name=\"info02\" ID=\"info05\" border=\"0\"></a></td>");
	else			document.writeln("<td valign=\"top\" align=\"right\"><a href=\"" + thePref + theLanguage + "/info/rassegna_stampa.htm\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info05_s.gif\" width=\"113\" height=\"20\" name=\"info05\" ID=\"info05\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	
	if (theSel != 'info04')	document.writeln("<td valign=\"top\" align=\"right\"><a href=\"javascript:popup('" + thePref + theLanguage + "/info/crediti.htm', '_blank', 440, 350);\"  onmouseover=\"return CSIShow(\'info04\',1)\" onmouseout=\"return CSIShow(\'info04\',0)\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info04_n.gif\" width=\"113\" height=\"20\" name=\"info04\" ID=\"info04\" border=\"0\"></a></td>");
	else			document.writeln("<td valign=\"top\" align=\"right\"><a href=\"#\"><img src=\"" + thePref + theLanguage + "/imcom"  + "/menu_info/info04_s.gif\" width=\"113\" height=\"20\" name=\"info04\" ID=\"info04\" border=\"0\"></a></td>");
	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";

	var bck1 = "white"
	var bck2 = "white"
	var bck3 = "white"
	var bck4 = "white"
	
	if (theSelMenu == 0) {
		stImg = "storia_s.gif";
		//bck1 = "#E4E4E4"
		bck1 = "#FFFFFF"
	}
	if (theSelMenu == 1) {
		viImg = "restauri_s.gif";
		//bck1 = "#E4E4E4"
		//bck2 = "#E4E4E4"
		bck1 = "#FFFFFF"
		bck2 = "#FFFFFF"
	}
	if (theSelMenu == 2) {
		anImg = "attivita_s.gif";
		//bck2 = "#E4E4E4"
		//bck3 = "#E4E4E4"
		bck2 = "#FFFFFF"
		bck3 = "#FFFFFF"
	}
	if (theSelMenu == 3) {
		anImg = "info_s.gif";
		//bck3 = "#E4E4E4"
		//bck4 = "#E4E4E4"
		bck3 = "#FFFFFF"
		bck4 = "#FFFFFF"
	}

	if (theDeep == 0)	document.writeln("<tr><td height=\"50\"><img height=\"50\" width=\"721\" 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=\"721\" src=\"" + thePref + "imcom/banner.jpg\" border=\"0\"></a></td>");
	document.writeln("</tr><tr>");
	document.writeln("<td><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"721\" bgcolor=\"#FFFFFF\"><tr>");
	document.writeln("<td width=\"196\" align=\"left\" bgcolor=\"" + bck1 + "\"><a href=\"javascript:openStoriaMenu()\" onmouseout=\"return CSIShow(\'mnstoria\',0)\" onmouseover=\"if (menuOpen) openStoriaMenu(); return CSIShow(\'mnstoria\',1);\"><img name=\"mnstoria\" ID=\"mnstoria\" height=\"21\" width=\"195\" src=\"" + thePref + theLanguage + "/imcom"  + "/" + stImg + "\" border=\"0\"></a></td>");
	document.writeln("<td width=\"206\" align=\"left\" bgcolor=\"" + bck2 + "\"><a href=\"javascript:openrestauriMenu()\" onmouseout=\"return CSIShow(\'mnrestauri\',0)\" onmouseover=\"if (menuOpen) openrestauriMenu(); return CSIShow(\'mnrestauri\',1);\"><img name=\"mnrestauri\" ID=\"mnrestauri\" height=\"21\" width=\"205\" src=\"" + thePref + theLanguage + "/imcom"  + "/" + viImg + "\" border=\"0\"></a></td>");
	document.writeln("<td width=\"206\" align=\"left\" bgcolor=\"" + bck3 + "\"><a href=\"javascript:openattivitaMenu()\" onmouseout=\"return CSIShow(\'mnattivita\',0)\" onmouseover=\"if (menuOpen) openattivitaMenu(); return CSIShow(\'mnattivita\',1);\"><img name=\"mnattivita\" ID=\"mnattivita\" height=\"21\" width=\"205\" src=\"" + thePref + theLanguage + "/imcom"  + "/" + arImg + "\" border=\"0\"></a></td>");
	document.writeln("<td width=\"72\" height=\"21\" align=\"left\" bgcolor=\"" + bck4 + "\"><a href=\"javascript: openInfoMenu()\" onmouseout=\"return CSIShow(\'mninfo\',0)\" onmouseover=\"if (menuOpen) openInfoMenu(); return CSIShow(\'mninfo\',1);\"><img name=\"mnandiam\" ID=\"mninfo\" height=\"21\" width=\"71\" src=\"" + thePref + theLanguage + "/imcom"  + "/" + inImg + "\" border=\"0\"></a></td>");
	document.writeln("<td width=\"41\" height=\"21\"><a href=\"" + theLangTarget + "\" onmouseout=\"return CSIShow(\'mnflag\',0)\" onmouseover=\"if (menuOpen) closeAllMenus(); return CSIShow(\'mnflag\',1);\"><img name=\"mnflag\" ID=\"mnflag\" src=\"" + thePref + theLanguage + "/imcom"  + "/" + theLanButton + "_n.gif\" width=\"41\" height=\"21\" border=\"0\"></a></td>");
	document.writeln("</tr></table></td></tr></table></td></tr>");
}

