//	---------------------------------------------------------------
//	Gestione del menù principale
//	---------------------------------------------------------------
var	i, j;
var	aMenu = new Array();
var urlName=document.location.href;

f_menu_voci();
f_menu_head();
f_menu_wl();
f_menu_foot();


//	---------------------------------------------------------------
//	Funzioni
//	---------------------------------------------------------------

//	Mette in array le voci di menu
function f_menu_voci()
{

// indicare nell'ordine 
//		NOME DEL LINK 
//		NOME DELLA PAGINA
//		1/0 (1=pagina abiliata 0=pagina disabilitata)
//		A/N (A  indentazione N non indentazione)   separate da ;
// 

	i=0;aMenu[i]=i+";Home;./home.html;1;N";
	i++;aMenu[i]=i+";Statuto;./anno2006/STATUTO_DEFINITIVO_18-12-2005.pdf;1;N";
	i++;aMenu[i]=i+";Dove siamo;./emilia_romagna.html;1;N";
	i++;aMenu[i]=i+";Il libro;./congrega_libro.html;1;N";
	i++;aMenu[i]=i+";Una storia;./una_storia.html;1;N";
	i++;aMenu[i]=i+";Quote 2010;./anno 2010/QUOTE 2010 soci, frequentatori e utenti.pdf;1;N";
	
	i++;aMenu[i]=i+";Regate 2010;./anno 2010/REGATE 2010.pdf;1;N";
		
		   
	   
	i++;aMenu[i]=i+";V. di Pasqua 2010;./anno 2010/Vele di Pasqua 2010 page.html;1;N";	
  		
		
	i++;aMenu[i]=i+";A Worlds 2010;./anno 2010/Worlds 2010.html;1;N";


	i++;aMenu[i]=i+";Ces&nautici 2010;./Cesenautici.html;1;N";	
	
    i++;aMenu[i]=i+";Scuola Vela 2010;./Scuola Vela 2010.html;1;N";	    
}


//	Crea la struttura <tr> di ogni singola voce di menù
function f_menu_wl()
{
	var msg, a_menu,href,l_chg_dsp,href_image,image;
	//var l_chg_dsp = 'onMouseOver="style.background=\'#D4DFF5\';" onMouseOut="style.background=\'transparent\'"';
	
	j=urlName.search("home")+1;	// se non lo trova torna -1
	if (j>0) j=1;
	for (i=j; i<aMenu.length; i++)
	{
		a_menu=aMenu[i].split(";");
		
		// se il terzo parametro è nullo allora non attivo il link
		if (a_menu[3] ==1 ) 
			{ href='<A HREF="' + a_menu[2]+ '">' ;
			l_chg_dsp = 'onMouseOver="style.background=\'#6CF4F2\';" onMouseOut="style.background=\'#3C909A\'"';
			image = "./images/pixel.gif"
			}
		else
			{ href='' ;
			  l_chg_dsp ='';
			  image = "./images/pixel.gif"
			};
				
	 	if (a_menu[4] == "A" )
			{ 
//				href_image = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +  href + '<img border="0" src="' + image + '" width="8" height="8">'
				href_image = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +  href + '<img border="0" src="' + image + '" width="8" height="8">' + '<font color="#FFFFFF">' 
			  	
			} 
		else 
			{href_image  =  href + '<img border="0" src="' + image + '" width="8" height="8">'  
			}; 
		if (a_menu[3] ==1 ) 
			{ 	
			msg = '<tr>'+
			'<td width="100%" '+l_chg_dsp+ ' style="COLOR: #FFFFFF; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 10px;  TEXT-DECORATION: none">' +  href_image +
			 '<font color="#FFFFFF">' + a_menu[1] + '</font></a >'+ '</td>'+ 	'</tr>';
			} 
		else 
			{ 
			msg = '<tr>'+	
			'<td width="100%" '+l_chg_dsp+ ' style="COLOR: #FFFFFF; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 10px;  TEXT-DECORATION: none">' +  href_image +
			 '<font color="#6CF4F2">' + a_menu[1] + '</font></a >'+ '</td>'+ 	'</tr>';
			};			
		document.writeln(msg);
		//alert (msg);
	}

}


function f_menu_head()
{
	document.writeln('<table border="0" width="147" cellspacing="3" cellpadding="3" bordercolor="#3C909A" style="border-top-width: 2px; border-left-width: 2px; border-bottom-width: 2px; border-right-width: 2px;" >' );
	document.writeln('<tr>');
	document.writeln('<td width="100%" align=center><img border="0" src="./images/logo.gif" width="91" height="96"></td>');
	document.writeln('</tr>');
	document.writeln('<tr>');
	document.writeln('<td width="100%">');
	document.writeln('<table border="0" width="100%" cellpadding="0" bgcolor="#3C909A">');
}


function f_menu_foot()
{
	document.writeln('</table>');
	document.writeln('</td>');
	document.writeln('</tr>');
	document.writeln('</table>');
}
