
theDeep	= 0;
thePref = "";
menuOpen = false;
filoOpen = false;
percOpen = false;

function InitMenus(deep) {
	theDeep = deep;
	
	var hrf = window.location.href;
	
	for (var i=0; i<deep; i++) thePref = thePref + "../";

	CSInit[CSInit.length] = new Array(CSILoad,"filo00",	thePref + "imcom"  + "/menu1/00.gif", thePref + "imcom/menu1/00_roll.gif",		"","");
	CSInit[CSInit.length] = new Array(CSILoad,"filo01",	thePref + "imcom"  + "/menu1/01.gif", thePref + "imcom/menu1/01_roll.gif",		"","");
	CSInit[CSInit.length] = new Array(CSILoad,"filo02",	thePref + "imcom"  + "/menu1/02.gif", thePref + "imcom/menu1/02_roll.gif",		"","");
	CSInit[CSInit.length] = new Array(CSILoad,"filo03",	thePref + "imcom"  + "/menu1/03.gif", thePref + "imcom/menu1/03_roll.gif",		"","");
	CSInit[CSInit.length] = new Array(CSILoad,"filo04",	thePref + "imcom"  + "/menu1/04.gif", thePref + "imcom/menu1/04_roll.gif",		"","");
	CSInit[CSInit.length] = new Array(CSILoad,"filo05",	thePref + "imcom"  + "/menu1/05.gif", thePref + "imcom/menu1/05_roll.gif",		"","");
	CSInit[CSInit.length] = new Array(CSILoad,"filo06",	thePref + "imcom"  + "/menu1/06.gif", thePref + "imcom/menu1/06_roll.gif",		"","");

	CSAct[ 'filoOn']	= new Array(CSShowHide, 'filo',	1);
	CSAct[ 'filoOff']	= new Array(CSShowHide, 'filo',	0);

}

function closeAllMenus() {
	CSAction(new Array('filoOff', 'percOff'));
	CSIShow("filo00",0);
	CSIShow("perc00",0);
	menuOpen = false;
	filoOpen = false;
	percOpen = false;
}

function openFiloMenu() {
	if (typeof(onOpenMainMenu) != "undefined") onOpenMainMenu();
	CSAction(new Array('filoOn', 'percOff'));
	CSIShow("filo00",1);
	menuOpen = true;
	filoOpen = true;
}

function openPercorsiMenu() {
	if (typeof(onOpenMainMenu) != "undefined") onOpenMainMenu();
	CSAction(new Array('filoOff', 'percOn'));
	CSIShow("perc00",1);
	menuOpen = true;
	percOpen = true;
}

function positionLayers() {
	aggancia("filo00",  "filo",			0, 21);
	aggancia("perc00",  "percorsi", 0, 21);
}

function writeMenus(naz) {
	document.writeln("<div id=\"filo\">");
	document.writeln("<table width=\"232\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.writeln("<tr><td height=\"21\"><a href=\"/index2.shtml\" onmouseover=\"CSIShow(\'filo01\',1)\" onmouseout=\"CSIShow(\'filo01\',0)\"><img name=\"filo01\" ID=\"filo01\" src=\"" + thePref + "imcom/menu1/01.gif\" width=\"232\" height=\"21\" border=0 alt=\" \"></td></tr>");
	document.writeln("<tr><td height=\"21\"><a href=\"/"+naz+"/racconto_filo.shtml\" onmouseover=\"CSIShow(\'filo02\',1)\" onmouseout=\"CSIShow(\'filo02\',0)\"><img name=\"filo02\" ID=\"filo02\" src=\"" + thePref + "imcom/menu1/02.gif\" width=\"232\" height=\"21\" border=0 alt=\" \"></td></tr>");
	document.writeln("<tr><td height=\"21\"><a href=\"/"+naz+"/soms.shtml\" onmouseover=\"CSIShow(\'filo03\',1)\" onmouseout=\"CSIShow(\'filo03\',0)\"><img name=\"filo03\" ID=\"filo03\" src=\"" + thePref + "imcom/menu1/03.gif\" width=\"232\" height=\"21\" border=0 alt=\" \"></td></tr>");
	document.writeln("<tr><td height=\"21\"><a href=\"/"+naz+"/servizi.shtml\" onmouseover=\"CSIShow(\'filo04\',1)\" onmouseout=\"CSIShow(\'filo04\',0)\"><img name=\"filo04\" ID=\"filo04\" src=\"" + thePref + "imcom/menu1/04.gif\" width=\"232\" height=\"21\" border=0 alt=\" \"></td></tr>");
	document.writeln("<tr><td height=\"21\"><a href=\"/"+naz+"/condizioni.shtml\" onmouseover=\"CSIShow(\'filo05\',1)\" onmouseout=\"CSIShow(\'filo05\',0)\"><img name=\"filo05\" ID=\"filo05\" src=\"" + thePref + "imcom/menu1/05.gif\" width=\"232\" height=\"21\" border=0 alt=\" \"></td></tr>");
	//document.writeln("<tr><td height=\"21\"><a href=\"/"+naz+"/contatti.htm\" onmouseover=\"CSIShow(\'filo06\',1)\" onmouseout=\"CSIShow(\'filo06\',0)\"><img name=\"filo06\" ID=\"filo06\" src=\"" + thePref + "imcom/menu1/06.gif\" width=\"232\" height=\"21\" border=0 alt=\" \"></td></tr>");
	document.writeln("</table></div>");                                                                                                                                                                                                                
	document.writeln("<div id=\"percorsi\">");
	//if(cit!=''){

		document.writeln("<table width=\"232\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
		//document.writeln("<tr><td height=\"21\"><a href=\"/"+naz+"/filo_intrecciati.htm\" 		onmouseover=\"CSIShow(\'perc02\',1)\" onmouseout=\"CSIShow(\'perc02\',0)\"><img name=\"perc02\" ID=\"perc02\" src=\"" + thePref + "imcom/menu2/00.gif\" width=\"232\" height=\"21\" border=0 alt=\" \"></td></tr>");
		document.writeln("<tr><td height=\"21\"><a href=\"/"+naz+"/filo_arte.shtml\" 		onmouseover=\"CSIShow(\'perc01\',1)\" onmouseout=\"CSIShow(\'perc01\',0)\"><img name=\"perc01\" ID=\"perc01\" src=\"" + thePref + "imcom/menu2/01.gif\" width=\"232\" height=\"21\" border=0 alt=\" \"></td></tr>");
	// //	document.writeln("<tr><td height=\"21\"><a href=\"/"+naz+"/filo_storia.htm\" 		onmouseover=\"CSIShow(\'perc02\',1)\" onmouseout=\"CSIShow(\'perc02\',0)\"><img name=\"perc02\" ID=\"perc02\" src=\"" + thePref + "imcom/menu2/02.gif\" width=\"232\" height=\"21\" border=0 alt=\" \"></td></tr>");
	// //	document.writeln("<tr><td height=\"21\"><a href=\"/"+naz+"/filo_gusto.htm\" 		onmouseover=\"CSIShow(\'perc03\',1)\" onmouseout=\"CSIShow(\'perc03\',0)\"><img name=\"perc03\" ID=\"perc03\" src=\"" + thePref + "imcom/menu2/03.gif\" width=\"232\" height=\"21\" border=0 alt=\" \"></td></tr>");
		document.writeln("<tr><td height=\"21\"><a href=\"/"+naz+"/filo_artigianato.shtml\" 	onmouseover=\"CSIShow(\'perc04\',1)\" onmouseout=\"CSIShow(\'perc04\',0)\"><img name=\"perc04\" ID=\"perc04\" src=\"" + thePref + "imcom/menu2/04.gif\" width=\"232\" height=\"21\" border=0 alt=\" \"></td></tr>");
		document.writeln("<tr><td height=\"21\"><a href=\"/"+naz+"/filo_natura.shtml\" 		onmouseover=\"CSIShow(\'perc05\',1)\" onmouseout=\"CSIShow(\'perc05\',0)\"><img name=\"perc05\" ID=\"perc05\" src=\"" + thePref + "imcom/menu2/05.gif\" width=\"232\" height=\"21\" border=0 alt=\" \"></td></tr>");
	// //	document.writeln("<tr><td height=\"21\"><a href=\"/"+naz+"/filo_mutualismo.htm\" 	onmouseover=\"CSIShow(\'perc06\',1)\" onmouseout=\"CSIShow(\'perc06\',0)\"><img name=\"perc06\" ID=\"perc06\" src=\"" + thePref + "imcom/menu2/06.gif\" width=\"232\" height=\"21\" border=0 alt=\" \"></td></tr>");
	//}
	document.writeln("</table></div>");
}

function writeMenuOpener() {
	document.writeln("<tr><td height=\"17\"><a href=\"javascript:openFiloMenu()\"			onmouseout=\"if(!filoOpen) CSIShow('filo00',0)\" onmouseover=\"CSIShow('filo00',1);\"><img name=\"filo00\" ID=\"filo00\" src=\"" + thePref + "imcom/menu1/00.gif\" alt=\"\" height=\"17\" width=\"232\" border=\"0\" alt=\" \"></a></td></tr>");
	document.writeln("<tr><td height=\"4\"><img src=\"/imcom/px_trasp.gif\" alt=\"\" height=\"4\" width=\"232\" border=\"0\"></td></tr>");
	document.writeln("<tr><td height=\"17\"><a href=\"javascript:openPercorsiMenu()\"	onmouseout=\"if(!percOpen) CSIShow('perc00',0)\" onmouseover=\"CSIShow('perc00',1);\"><img name=\"perc00\" ID=\"perc00\" src=\"" + thePref + "imcom/menu2/00.gif\" alt=\"\" height=\"17\" width=\"232\" border=\"0\" alt=\" \"></a></td></tr>");

}
