//-- Top Menu

function createTopMenu( menuName )
{
  MenuArea = MM_findObj( 'Menu' + menuName );
  if( MenuArea != null )
  {
    MenuContent = '<table border="0" cellspacing="0" cellpadding="0"><tr>';
    itemsTable = 'Menu' + menuName + 'Items';
	if (menuName == 'Franziska'){
	    MenuContent += '<td><img src="/image/d.gif" width="10" height="1"></td>';
	}
	else if (menuName == 'Fondation'){
	    MenuContent += '<td><img src="/image/d.gif" width="10" height="1"></td>';
	}
	else if (menuName == 'News'){
	    MenuContent += '<td><img src="/image/d.gif" width="135" height="1"></td>';
	}
	else if (menuName == 'Album'){
	    MenuContent += '<td><img src="/image/d.gif" width="255" height="1"></td>';
	}
    for( i=0; i < eval(itemsTable + '.length'); i++ )
    {
	  last_item = 0;
	  if ( i == eval(itemsTable + '.length') - 1 ) {
		  last_item = 1;
	  }
      temp = itemsTable + '[' + i + ']';
	  if (thisMenu ==  menuName){
	      addTopMenuItem( i, eval( temp + '[0]' ), eval( temp + '[1]' ), eval( temp + '[2]' ), last_item );
	  }
	  else{
	      addTopMenuItem( -1 , eval( temp + '[0]' ), eval( temp + '[1]' ), eval( temp + '[2]' ), last_item );
	  }
    }
    MenuContent += '</tr></table>';
	// special for Home menu: just nothing inside
	if(menuName == 'Home'){
	    MenuContent = '';
	}
    MenuArea.innerHTML = MenuContent;
  }
}

function addTopMenuItem( menu, text, link, target )
{
	textcolor = "#C0C0C0";
	mouseovercolor = "#000000";
	mouseoutcolor = "#C0C0C0";
	if (menu + 1 == nbMenu){
//		text = "<u>" + text + "</u>";
		textcolor = "#000000";
		mouseoutcolor = "#000000";
	}
	if (target != '') {
		MenuContent += '<TD id="hand" class="menu" nowrap onMouseOver="MenuMouseOver();" onMouseOut="MenuMouseOut();"><i>&nbsp;&nbsp;<a href="' + link + '" target="' + target + '" onMouseOver="style.color=\'' + mouseovercolor + '\';" onMouseOut="style.color=\'' + mouseoutcolor + '\';" style="color:' + textcolor + '; text-decoration: none">' + text + '</a>&nbsp;</i></TD>';
	} else {
		MenuContent += '<TD id="hand" class="menu" nowrap onMouseOver="MenuMouseOver();" onMouseOut="MenuMouseOut();"><i>&nbsp;&nbsp;<a href="' + link + '" onMouseOver="style.color=\'' + mouseovercolor + '\';" onMouseOut="style.color=\'' + mouseoutcolor + '\';" style="color:' + textcolor + '; text-decoration: none">' + text + '</a>&nbsp;</i></TD>';
	}
}


//-- Menu definition
//-- Top Menu

MenuHomeItems =
[
  []
];

MenuFranziskaItems =
[
  ['Portrait', '/f/portrait.php', ''], ['Palmarès', '/f/palmares.php', ''], ['Grandes victoires', '/f/victoires.php', ''], ['Records personnels', '/f/records.php', ''], ['Photos', '/f/photos.php', '']
];

MenuFondationItems =
[
  ['Promotion', '/f/promotion.php', ''], ['Cadre', '/f/cadre.php', ''], ['Soutien', '/f/soutien.php', ''], ['Manifestations', '/f/manifestation.php', ''], ['Solidarité', '/f/solidarite.php', '']
];

MenuAlbumItems =
[
//  ['Soirée de Gala 03', '/f/album.php', ''], ['Athletissima', '#', ''], ['Philippe Rochat', '#', ''], ['Franziska', '#', '']
  ['Soirée de Gala 03', '/f/album.php', '']
];

MenuNewsItems =
[
  ['News 1', '#', ''],  ['News 2', '#', '']
];


//-- Menu Creation
createTopMenu( 'Franziska' );
createTopMenu( 'Fondation' );
createTopMenu( 'Album' );
createTopMenu( 'News' );

MenuReady = true;

ShowMenu(menu);

