page_mail="";
top_page="";
its_about="";
plan=false;
nb_colspan1 = 0;
nb_colspan2 = 0;
pages = new Array ( "_index",
                    "_pov",
		    "_avs", "avs1", "avs2", "avs3", "avs4",
		    "avs5", "avs6", "avs7", "avs8", "avs_real", "avs_en",
		    "_astro", "astro0", "astro1", "astro2", "astro3", "astro4",
		    "astro5", "astro6", "astro7", "astro8", "astro9", "astro10",
		    "astro11",
		    "_conduire", "conduire0", "conduire99",
		    "_poesie",
		    "_jeu", "jeu1", "jeu2", "jeu3", "jeu4",
		    "_lien",
		    "_qui",
		    "_auteur" );
titres= new Array ( "Accueil",
                    "POV-Ray",
		    "AVS", "Tut.1 : Pr&eacute;sent.", "Tut.2 : Menu +",
		    "Tut.3 : Render 1", "Tut.4 : Render 2", "Tut.5 : Trans 1",
		    "Tut.6 : Trans 2", "Tut.7 : Trans 3", "Tut.8 : Aide/expr.",
		    "Mes r&eacute;alisations", "In English please",
		    "Astronomie", "Soleil", "Mercure", "V&eacute;nus", "Terre", "Mars",
		    "Jupiter", "Saturne", "Uranus", "Neptune", "Plan&egrave;tes naines", "Ast&eacute;ro&iuml;des et com&egrave;tes",
		    "Balade virtuelle",
		    "Conduire", "Trucs et astuces", "Test de r&eacute;flexes",
		    "Po&eacute;sie",
		    "Jeux", "Clics", "Multiplication", "Couleurs", "Solitaire",
		    "Liens",
		    "Qui vient ?",
		    "L'auteur" );

function box_on ()
{
  document.write("<TABLE width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >");
  // bordure haute
  document.write("<TR>");
  document.write("<TD class=\"hg\" width=\"8\" height=\"8\"></TD>");
  document.write("<TD class=\"hm\" ></TD>");
  document.write("<TD class=\"hd\" width=\"8\"></TD>");
  document.write("</TR>");
  // contenu
  document.write("<TR>");
  document.write("<TD class=\"mg\" ></TD>");
  document.write("<TD class=\"mc\">");
}

function box_off ()
{
  document.write("</TD>");
  document.write("<TD class=\"md\"></TD>");
  document.write("</TR>");
  document.write("<TR>");
  document.write("<TD class=\"bg\" height=\"8\"></TD>");
  document.write("<TD class=\"bm\"></TD>");
  document.write("<TD class=\"bd\"></TD>");
  document.write("</TR>");
  document.write("</TABLE>");
}

function language( lg )
{
  if ( lg == "en" )
  { top_page="Top of page";
    its_about="About Chez Pierrot ";
    send_mail="Send me an e-mail";
    send_file="If the downloading doesn't start automatically, click here: ";
    clos_win="Close this window";
  }
  else
  { top_page="Haut de page";
    its_about="Au sujet de Chez Pierrot ";
    send_mail="Envoyez-moi un courriel";
    send_file='Si le t&eacute;l&eacute;chargement ne d&eacute;marre pas automatiquement cliquez ici : ';
    clos_win="Fermer cette fen&ecirc;tre";
  }
}

function menu (page_in)
{
  page_stat=page_in;
  page_mail="("+page_in+")";
  if ( page_in == "avs_en" )
  { language("en");
    plan=false;
  }
  else
  { language( "fr" );
    if ( page_in == "plan" )
    { plan=false;
      page_in="index";
    }
    else
    { plan=true;
    }
  }

  document.write("<A NAME=\"_top\">");
  // haut de page
  box_on();
  // bandeau
  document.write("<CENTER><BR>");
  document.write("<IMG SRC=\"img/chezpie2.gif\" alt=\"Chez Pierrot\"> <BR><BR>");
  document.write("</CENTER>");
  // menus
  document.write("<TABLE cellspacing=\"0\" cellpadding=\"5\" width=\"100%\" >");
  nb_colspan1 = 0;
  menu1_line = "";
  base_line="";
  for ( j in pages )  // pour chaque page
  {
    base = pages[j];
    if ( base.substr(0,1) == "_" ) // entrée principale
    {
      // menu 1er niveau
      nb_colspan1 += 1;
      base = pages[j].slice(1);
      base_on = page_in.match(base+".*");  // page ou sous page active
      // séparateur menu bas d écran
      if ( j == 0 )
      { sep="";
      }
      else
      { sep=" - ";
      }
      // construction du menu
      if ( base_on )
      { // pas de lien
	menu1_line = menu1_line + "<TD class=\"mm\"><B>" + titres[j] + "</B></TD>";
	base_line = base_line + sep + titres[j];
      }
      else
      {  // lien vers la page
	menu1_line = menu1_line + "<TD class=\"mmo\"><A HREF=\"" + base +".html\">" + titres[j] + "</A></TD>";
	base_line = base_line + sep + "<A HREF=\"" + base +".html\">" + titres[j] + "</A>";
      }

      last_j = j;

      if ( base_on )
      {
        // menu 2ème niveau
        nb_colspan2 = 1;
        ssbase_on = ( page_in == base );  // sous page active
	// construction
	if ( ssbase_on )
	{ // pas de lien
	  menu_line2 = "<TD class=\"mm8\"><B>Accueil</B></TD>";
	}
	else
	{  // lien vers la page
	  menu_line2 = "<TD class=\"mm8o\"><A HREF=\"" + base +".html\">Accueil</A></TD>";
	}
      }
    }
    else  // entrées secondaires
    {
      if ( base_on )
      {
        // menu 2ème niveau (suite)
        nb_colspan2 += 1;
        ssbase_on = ( page_in == base );  // sous page active
	// construction
	if ( ssbase_on )
	{ // pas de lien
	  menu_line2 = menu_line2 + "<TD class=\"mm8\"><B>" + titres[j] +"</B></TD>";
	}
	else
	{  // lien vers la page
	  menu_line2 = menu_line2 + "<TD class=\"mm8o\"><A HREF=\"" + base +".html\">"+titres[j]+"</A></TD>";
	}
      }
    }
  }
  // édition ligne de menu
  document.write("<TR>");
  document.write(menu1_line);
  document.write("</TR>");

  // fin du menu 1er niveau
  document.write("<TD class=\"mmi\" colspan=\""+nb_colspan1+"\" width=\"*\" >");

  if ( nb_colspan2 > 1 )
  {
    // édition du menu 2ème niveau
    document.write("<BR><TABLE cellspacing=\"0\" cellpadding=\"5\" width=\"100%\" >");
    document.write("<TR>");
    document.write(menu_line2);
    document.write("</TR>");
    document.write("<TD class=\"mm8i\" colspan=\""+nb_colspan2+"\" width=\"*\" >");
  }
}

function sendfile(titre, chemin)
{
  send = open("",'send','width=400,height=140,resizable=yes,toolbar=no,scrollbars=no');
  send.document.open();
  send.document.write( '<html><head>' );
  send.document.write( '<META http-equiv="Refresh" content="0; url='+chemin+'">' );
  send.document.write( '<title>'+titre+'</title>' );
  send.document.write( '<link href="site.css" rel="stylesheet" type="text/css"> ');
//  send.document.write( '<script language="javascript" src="menu.js"></script>' );
  send.document.write( '</head>' );
  send.document.write( '<body><center>' );
  send.document.write( send_file + '<A HREF="'+chemin+'">'+titre+'</A><BR><BR>');
  send.document.write( '<A HREF="javascript:close()">'+clos_win+'</A><BR><BR>' );
  send.document.write( '</center>' );

  send.document.write('<a href="http://www.xiti.com/xiti.asp?s=353734" title="WebAnalytics"> ');
  Xt_param = 's=353734&p='+titre;
  try {Xt_r = top.document.referrer;}
  catch(e) {Xt_r = document.referrer; }
  Xt_h = new Date();
  Xt_i = '<img width="39" height="25" border="0" alt="" ';
  Xt_i += 'src="http://logv145.xiti.com/hit.xiti?'+Xt_param;
  Xt_i += '&hl='+Xt_h.getHours()+'x'+Xt_h.getMinutes()+'x'+Xt_h.getSeconds();
  if(parseFloat(navigator.appVersion)>=4)
  { Xt_s=screen;Xt_i+='&r='+Xt_s.width+'x'+Xt_s.height+'x'+Xt_s.pixelDepth+'x'+Xt_s.colorDepth; }
  send.document.write(Xt_i+'&ref='+Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$')+'" title="Internet Audience">');
  send.document.write("</a>");

  send.document.write( '</body>' );
  send.document.write( '</html>' );
  send.document.close();
}

function sendmail(titre)
{
  fen=window.open("mailto:chez.pierrot@neuf.fr?subject="+titre, "new", "width=100,height=100,resizable=no,status=no,toolbar=no,menubar=no");
  fen.close();
}

function xiti( page )
{
  document.write("<a href=\"http://www.xiti.com/xiti.asp?s=353734\" title=\"WebAnalytics\"> ");
  Xt_param = 's=353734&p='+page;
  try {Xt_r = top.document.referrer;}
  catch(e) {Xt_r = document.referrer; }
  Xt_h = new Date();
  Xt_i = '<img width="39" height="25" border="0" alt="" ';
  Xt_i += 'src="http://logv145.xiti.com/hit.xiti?'+Xt_param;
  Xt_i += '&hl='+Xt_h.getHours()+'x'+Xt_h.getMinutes()+'x'+Xt_h.getSeconds();
  if(parseFloat(navigator.appVersion)>=4)
  { Xt_s=screen;Xt_i+='&r='+Xt_s.width+'x'+Xt_s.height+'x'+Xt_s.pixelDepth+'x'+Xt_s.colorDepth; }
  document.write(Xt_i+'&ref='+Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$')+'" title="Internet Audience">');
  document.write("</a>");
}

function end_menu()
{ 
  if ( nb_colspan2 > 1 )
  {
    // fin 2ème niveau
    document.write("</TD>");
    document.write("</TR>");
    document.write("</TABLE>");
  }

  document.write("<P style=\"text-align: right\">");
  document.write("<A HREF=\"#_top\">"+top_page+" <IMG SRC=\"img/flh.gif\" border=\"0\" align=\"middle\"></A>");
  document.write("</P>");
  // fin 1er niveau
  document.write("</TD>");
  document.write("</TR>");
  document.write("</TABLE>");

  document.write("<CENTER>"+base_line+"<BR><BR>");
  if ( plan )
  { document.write("<FONT SIZE=\"-1\"><A HREF=\"plan.html\">Plan du site</A></FONT><BR><BR>");
  }
  document.write("<A HREF=\"javascript:sendmail('"+its_about+page_mail+"')\"><IMG SRC=\"img/mail.gif\" border=\"0\"> "+send_mail+"</A><BR><BR> ");
  document.write('<BR></CENTER>');
  // =========
  xiti(page_stat);
  // fin de page
  box_off();
  // compteurs
  document.write('<CENTER>');
  document.write('<script type="text/javascript" src="http://www.abcompteur.com/cpt/?code=6/49/11232/2/1&ID=626604"></script>');
  document.write('<script type="text/javascript" src="http://www.abcompteur.com/live/?code=0/111/11232/2/1&ID=626606"></script>');
  document.write('</CENTER>');
}

function download(url)
{
  fen=window.open(url, "new", "width=350,height=100,resizable=no,status=no,toolbar=no,menubar=no");
}

