// Attention: Necessite la definition de des tableaux partie, textepart, tSommaireCart, textecart
// pour fonctionner: s'applique aux textes en plusieurs parties

function ecrireSpanfleches(n)
{
	var numMaxListeParties = textepart.length-1;

    if (n>0)
    {
        sSpanPrec  = "<SPAN CLASS='commentaires-dyn' ID='id";
        sSpanPrec += textepart[n-1][0] + "'>";
        sTxtPrec   = textepart[n-1][1];
                
        document.write(sSpanPrec);
        document.write(sTxtPrec);
        document.write("</SPAN>");    
    }

    document.write("<SPAN CLASS='commentaires-dyn' ID='idSommaire'>");
    document.write(tSommaireCart[0]);
    document.write("</SPAN>");    

    if (n<numMaxListeParties)
    {
        sSpanPrec  = "<SPAN CLASS='commentaires-dyn' ID='id";
        sSpanPrec += textepart[n+1][0] + "'>";
        sTxtPrec   = textepart[n+1][1];
                
        document.write(sSpanPrec);
        document.write(sTxtPrec);
        document.write("</SPAN>");    
    }


	// -----------------------------------------------
	// Ecriture des tableaux qui vont permettre l'affichage des cartouches contextuels
	
	var sLabellePrec="<- ";
	var sLabelleSuiv="-> ";
	
	if ( (this.tableauComp != undefined) && (tableauComp.length > 0) )
	{
		tableauComp.reverse();
	}
	else 
	{
		tableauComp = new Array();
	}
	
	if (n<numMaxListeParties)
    {
		tableauComp = tableauComp.concat([[sLabelleSuiv+textecart[n+1][1], textecart[n+1][0]]]);
    } 

	if (n>0)
	{
		tableauComp = tableauComp.concat([[sLabellePrec+textecart[n-1][1], textecart[n-1][0]]]);
	}

	tableauComp = tableauComp.concat([tSommaireCart]);
	
	tableauComp.reverse();
		
}

function ecrireFleches(n)
{    
	var numMaxListeParties = textepart.length-1;

 	document.write("<div class='aligncentre'>");

    if (n>0)
    {
        sLienrec  = "<A HREF='" + textepart[n-1][0] + ".html' ";
        sLienrec += "TARGET='_top' onMouseOver=\"ouvrirCommentaire(event, 'id";
        sLienrec += textepart[n-1][0];
        sLienrec += "')\" onMouseOut='fermerNote(true)' onClick='fermerNote(true)' ALT='";
        sLienrec += textepart[n-1][0] + "'>";
        
        document.write(sLienrec);
        document.write("<IMG BORDER=0 SRC='flecheg.gif'>");
        document.write("</A>");
        
        document.write("&nbsp;&nbsp;&nbsp;&nbsp;");
   }
    
    document.write("<A HREF='" + tSommaireCart[1]+ "' TARGET='_top' onMouseOver=\"ouvrirCommentaire(event, 'idSommaire')\" onMouseOut='fermerNote(true)' onClick='fermerNote(true)' ALT='" + tSommaireCart[0] + "'>");
    document.write("<IMG BORDER=0 SRC='flecheh.gif'>");
    document.write("</A>");
    document.write("&nbsp;&nbsp;&nbsp;&nbsp;");

    if (n<numMaxListeParties)
    {
        sLienSuiv  = "<A HREF='" + textepart[n+1][0] + ".html' ";
        sLienSuiv += "TARGET='_top' onMouseOver=\"ouvrirCommentaire(event, 'id";
        sLienSuiv += textepart[n+1][0];
        sLienSuiv += "')\" onMouseOut='fermerNote(true)' onClick='fermerNote(true)' ALT='";
        sLienSuiv += textepart[n+1][0] + "'>";
        
        document.write(sLienSuiv);
        document.write("<IMG BORDER=0 SRC='fleched.gif'>");
        document.write("</A>");
    }
    
	document.write("</div>");
    
}

function ecrireNavFlecheComplet(n)
{
	ecrireSpanfleches(n);
	ecrireFleches(n);
}

