ACCUEIL = 0;
CLUB = 1;
ACTUALITE = 2;
JUDO = 3;
JUJITSU = 4;
TAISO = 5;
COMPETITION = 6;
PREPAPHYSIQUE = 7;
RUBRIQUEABRAC = 8;
LEXIQUE = 9;
BOUTIQUE = 10;
FORUM = 11;
PHOTOS_VIDEOS = 12;
BUREAU = 13
RECHERCHE = 14;
LIENS = 15;
CONTACTS = 16;
MENU_NB = 17;

SIZE_JUDO_KATAS = 8;
JUDO_KATAS_IDX = 4;
SIZE_ACCUEIL = 0;
SIZE_CLUB = 5;
SIZE_ACTUALITE = 2;
SIZE_JUDO = 6+SIZE_JUDO_KATAS;
SIZE_JUJITSU = 3;
SIZE_TAISO = 0;
SIZE_PREPAPHYSIQUE = 6;
SIZE_COMPETITION = 3;
SIZE_RUBRIQUEABRAC = 4;
SIZE_LEXIQUE = 0;
SIZE_BOUTIQUE = 0;
SIZE_FORUM = 0;
SIZE_LIENS = 0;
SIZE_PHOTOS_VIDEOS = 0;
SIZE_BUREAU = 0;
SIZE_RECHERCHE = 0;
SIZE_CONTACTS = 2;
LINK_NB = SIZE_ACCUEIL + SIZE_CLUB + SIZE_ACTUALITE + SIZE_JUDO + SIZE_JUJITSU + SIZE_TAISO + SIZE_PREPAPHYSIQUE +
          SIZE_COMPETITION + SIZE_RUBRIQUEABRAC + SIZE_LEXIQUE + SIZE_BOUTIQUE + SIZE_FORUM +
          SIZE_PHOTOS_VIDEOS + SIZE_BUREAU + SIZE_LIENS + SIZE_RECHERCHE + SIZE_CONTACTS;

menuChildNb = new Array( SIZE_ACCUEIL,SIZE_CLUB,SIZE_ACTUALITE,SIZE_JUDO,SIZE_JUJITSU,SIZE_TAISO,
                         SIZE_COMPETITION,SIZE_PREPAPHYSIQUE,SIZE_RUBRIQUEABRAC,SIZE_LEXIQUE,
						 SIZE_BOUTIQUE,SIZE_FORUM,SIZE_PHOTOS_VIDEOS,SIZE_BUREAU,
                         SIZE_RECHERCHE,SIZE_LIENS,SIZE_CONTACTS);
var menuChildIndex = new Array(MENU_NB);
                       
var menuStatus = new Array(MENU_NB);
var linkImage = new Array(LINK_NB);
var linkName = new Array('<a href="http://aschantepiejudo.comze.com/dokuwiki-2008-05-05/doku.php?id=club:agenda" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Agenda</a><br>',
                     '<a href="PageClubHoraires.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Horaires</a><br>',
                     '<a href="PageClubPresentation.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Pr&eacute;sentation</a><br>',
                     '<a href="PageClubInformations.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Informations</a><br>',
                     '<a href="http://aschantepiejudo.comze.com/dokuwiki-2008-05-05/doku.php?id=club:reglement" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Règlement intérieur</a><br>',
                     /*'<a href="PageActualite.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Actus</a><br>',*/
                     '<a href="http://aschantepiejudo.comze.com/dokuwiki-2008-05-05/doku.php?id=actualites:actualites" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Actus</a><br>',
                     '<a href="http://aschantepiejudo.comze.com/dokuwiki-2008-05-05/doku.php?id=actualites:presse" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Revue de presse</a><br>',
                     '<a href="PageJudoHistorique.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Historique</a><br>',
                     /*'<a href="PageJudoCodeMoral.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Code moral</a><br>',*/
					'<a href="http://aschantepiejudo.comze.com/dokuwiki-2008-05-05/doku.php?id=judo:code_moral" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Code moral</a><br>',                     
					'<a href="PageJudoTechniquesDebout.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Techniques Debout</a><br>',
                     '<a href="PageJudoTechniquesSol.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Techniques sol</a><br>',
                     '<a href="PageJudoKatas.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Katas</a><br>',
                     '<a href="PageNageNoKataStatique.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Nage No Kata</a><br>',
                     '<a href="PageKatameNoKata.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Katame No Kata</a><br>',
                     '<a href="PageKimeNoKata.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Kime No Kata</a><br>',
                     '<a href="PageJuNoKata.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Ju No Kata</a><br>',
                     '<a href="PageKoshikiNoKata.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Koshiki No Kata</a><br>',
                     '<a href="PageItsutsuNoKata.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Itsutsu No Kata</a><br>',
                     '<a href="PageGoshinJutsuNoKata.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Goshin Jutsu No Kata</a><br>',
                     '<a href="PageGoNoSenNoKata.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Go No Sen No Kata</a><br>',
                     '<a href="PageJudoPassageGrades.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Passage de Grades</a><br>',
                     '<a href="PageJujitsuHistorique.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Historique</a><br>',
                     '<a href="PageJujitsuKatas.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Katas</a><br>',
                     '<a href="PageJujitsuAtemiWaza.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Atemi Waza</a><br>',
                     '<a href="PageArbitrage.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Arbitrage</a><br>',
                     '<a href="http://aschantepiejudo.comze.com/dokuwiki-2008-05-05/doku.php?id=competition:resultats" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Calendrier / R&eacute;sultats</a><br>',
                     '<a href="PageJudoCompetitionResultats.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Calendrier / R&eacute;sultats (Ancienne version)</a><br>',
                     '<a href="PagePrepaPhysEchauffement.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Echauffement et &eacute;tire...</a><br>',
                     '<a href="PreparationPhysiqueEtEntrainement.doc" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;" title="Entra&icirc;nement et pr&eacute;paration physique">Entrainement et pr&eacute;pa ...</a><br>',
                     '<a href="PagePrepaPhysiqueFilieresEnergetiques.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;" title="Fili&egrave;res &eacute;nerg&eacute;tiques et contractions musculaires">Fili&egrave;res &eacute;nerg&eacute;tiques et ...</a><br>',
                     '<a href="RecapitulatifFilieresEnergetiquesEtLeurSollicitation.xls" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;" title="Sollicitations des fili&egrave;res &eacute;nerg&eacute;tiques">Sollicitations des fili&egrave;res ...</a><br>',
                     '<a href="AdaptationsDeLOrganismeAUnEntrainementDeForce.doc" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;" title="Adaptation de l\'organisme &agrave; un entra&icirc;nement de force">Adaptation de l\'organisme ...</a><br>',
                     '<a href="JudoEtMusculationModeEmploi.doc" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">S&eacute;ances types</a><br>',                   
                     '<a href="PageDietetique.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Di&eacute;t&eacute;tique</a><br>',
                     '<a href="PageSante.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Sant&eacute;</a><br>',
                     '<a href="PageDetente.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">D&eacute;tente</a><br>',
                     '<a href="PageDessins.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Dessins</a><br>',
                     '<a href="PageContact.html" target="main" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Contact</a><br>',
                     '<a href="mailto:aschantepiejudo@idoo.com?subject=Question%20au%20Webmaster" style="font-family: Arial, Sans-serif;font-size: 11px;color:#000000;text-decoration:none;">Webmaster</a><br>')

/* This function initializes the menuStatus array */
function menuStatusInit()
{
var i;

  for(i=0;i<MENU_NB;i++)
    menuStatus[i] = 0;  
} /* menuStatusInit */

function linkImageInit()
{
var i;
var j;
var linkImageIndex = 0;
    
  for(i=0;i<MENU_NB;i++)
  {
    menuChildIndex[i] = linkImageIndex;
    if( menuChildNb[i] > 0 )
    {
      if( menuChildNb[i] > 1 )
      {
        for(j=0;j<menuChildNb[i]-1;j++)
        {
          linkImage[linkImageIndex] = '<img alt="" src="../Images/tree-T.gif" align="abmiddle" border=0>';
          linkImageIndex++;
        }    
      }
      linkImage[linkImageIndex] = '<img alt="" src="../Images/tree-L.gif" align="abmiddle" border=0>';              
      linkImageIndex++;
    }    
  }  
} /* linkImageInit */

function headerInit()
{
var i;

  menuStatusInit();
  linkImageInit();
  for(i=0;i<MENU_NB;i++)
  {
    if( menuChildNb[i] > 0 )
      document.getElementById("image"+i).innerHTML = '<img src="../Images/close.gif" alt="" border=0>';
    else
      document.getElementById("image"+i).innerHTML = '<img src="../Images/vide.gif" alt="" border=0>';
  }   
} /* headerInit */

function Close(n)
{
  document.getElementById("header"+n).innerHTML = '';
  document.getElementById("header"+n).style.position = 'absolute';
  document.getElementById("image"+n).innerHTML = '<img src="../Images/close.gif" alt="" border=0>';
}

function Open(n)
{
var i;
var j;
var headerString = '';

  document.getElementById("header"+n).style.position = 'relative';
  
  if( menuStatus[n] == 0 )
  {
    if( menuChildNb[n] > 0 )
    {
      for(i=0;i<menuChildNb[n];i++)
      {	 
        headerString += '&nbsp;&nbsp;' + linkImage[menuChildIndex[n]+i] + '&nbsp;' + linkName[menuChildIndex[n]+i];
	    if( (n == JUDO) && (i == JUDO_KATAS_IDX) )
        {
          for(j=1;j<=SIZE_JUDO_KATAS;j++)
		  {
            headerString += '&nbsp;&nbsp;<img alt="" src="../Images/tree-level2.gif" align="abmiddle" border=0>'
		    if( j==SIZE_JUDO_KATAS )
              headerString += '&nbsp;&nbsp;<img alt="" src="../Images/tree-L.gif" align="abmiddle" border=0>&nbsp;' + linkName[menuChildIndex[n]+i+j];
			else
			  headerString += '&nbsp;&nbsp;' + linkImage[menuChildIndex[n]+i+j] + '&nbsp;' + linkName[menuChildIndex[n]+i+j];
	      }
 		  i += SIZE_JUDO_KATAS;
		}
      }
      document.getElementById("header"+n).innerHTML = headerString;
      document.getElementById("image"+n).innerHTML = '<img src="../Images/open.gif" alt="" border=0>';
      menuStatus[n] = 1;
    }    
  }
  else
  {
    javascript:Close(n);
    menuStatus[n] = 0;
  }
}
