// JavaScript Document
function menucoursbio()
{
  document.writeln(
    "<table width=100% style='margin:0px;'>",
      "<tr style='background:blue;color:white;margin:0px;'>",
        "<td class=menu>",
           "<a class=menu href='coursbio.htm' title=\"Le sommaire.\">Sommaire</a>",
        "</td>",
        "<td class=menu>",
           "<a class=menu href='vegetaux.htm' title=\"Les végétaux.\">Végétaux</a>",
		"</td>",
        "<td class=menu>",
           "<a class=menu href='spongiaires.htm' title=\"Les éponges.\">Eponges</a>",
		"</td>",
        "<td class=menu>",
           "<a class=menu href='cnidaires.htm' title=\"Les cnidaires et les bryozoaires.\">",
		   "Cnidaires</a>",
		"</td>",
        "<td class=menu>",
           "<a class=menu href='vers.htm' title=\"Les vers et les vers plats.\">Vers</a>",
		"</td>",
        "<td class=menu>",
           "<a class=menu href='arthropodes.htm' title=\"Les crustacés.\">Arthropodes</a>",
        "</td>",
        "<td class=menu>",
           "<a class=menu href='mollusques.htm' ",
		   "title=\"Les coquillages, les nudibranches et les céphalopodes.\">Mollusques</a>",
        "</td>",
        "<td class=menu>",
           "<a class=menu href='echinodermes.htm' ",
		   "title=\"Les étoiles de mer, ophiures, oursins et holothuries.\">Echinodermes</a>",
        "</td>",
        "<td class=menu>",
           "<a class=menu href='tuniciers.htm' title=\"Les ascidies et les thaliacés.\">Tuniciers</a>",
        "</td>",
        "<td class=menu>",
           "<span style='position:relative;top:23px;background-color:blue;display:none'>poissons tropicaux</span>",
           "<a class=menu href='vertebres.htm' title=\"Les vertébrés.\">Vertébrés</a>",
        "</td>",
	"<td class=menu>",
           "<a class=menu href='biologie.htm' title=\"Pour aller plus loin.\">Biologie</a>",
		"</td>",
       "</tr>",
     "</table>");
/*          "<td style='border-top:white 1px solid;border-bottom:white 1px solid;",
          "     border-right:white 1px solid;border-left:0px;'>&nbsp;</td>",
		"<td style='border-top:white 1px solid;border-bottom:white 1px solid;",
            "   border-right:white 1px solid;border-left:0px;'>&nbsp;</td>",*/
}

function photoquizz(photo, nomc, noml, texte, photo2, dimnostd)
{
  id=String(Math.random());
  /*escape(photo);*/
  if (typeof(photo2) != "undefined" && photo2 != "")
        document.writeln("<a href=\"javascript:showtexte('"+id+"')\" "+
	     "onmouseOver=\"document.images['"+photo+"'].src='images/"+photo2+"';\" "+
	     "onmouseOut=\"document.images['"+photo+"'].src='images/"+photo+"';\">");
  else document.writeln("<a href=\"javascript:showtexte('"+id+"')\">");
/*altphoto('"+photo+"','"+photo2+"');\" "+*/
/*	     "onmouseOut=\"altphoto('"+photo+"','"+photo+"');\">");*/
  
  document.writeln("<img name='"+photo+"' src=\"images/" + photo +
                       "\" title=\"Cliquez sur l'image pour voir son nom\"");
  if (typeof(dimnostd) == "undefined")
    document.writeln(" width=350 height=230");
  document.writeln("></a>");
  
  document.writeln("<div id=\""+id+"\" style=\"visibility:hidden;text-align=justify\">",
				   "<h6 style=\"text-align=center\">", nomc);

  if (typeof(noml) != "undefined" && noml != "")  document.writeln(" <i>(", noml, ")</i>");
  document.writeln("</h6>");
  if (typeof(texte) != "undefined") document.writeln(texte);
  document.writeln("</div>");
}

function biphoto(titre1, photo1, titre2, photo2, noresize)
{
  params='';
  if (noresize != '1') params='width=350 height=230';
  id1='biph'+String(Math.random());  id2='biph'+String(Math.random());
  document.writeln('<div id="', id1,'" style="display:block;cursor:pointer" ',
                   "onclick='cache(\"", id1,"\");montre(\"", id2 ,"\");' title='Cliquez pour changer la photo'>",  
 		   '<img src="images/', photo1, '" ', params,'><br>', titre1 , '</div>' );
  document.writeln("<div id='",id2,"' style='display:none;cursor:pointer' title='Cliquez pour changer la photo'",
                   "onclick=\"cache('",id2,"');montre('",id1,"');\">",
 		   '<img src="images/', photo2, '" ', params,'><br>', titre2 , '</div>');
}

function PopupImage(img) { 
titre="Agrandissement"; 
w=open("",'image','width=350,height=230,toolbar=no,scrollbars=no,resizable=no,status=no');
w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>"); 
w.document.write("<SCRIPT language=javascript>function checksize() { ",
                   "if (document.images[0].complete) { ",
                     "window.resizeTo(document.images[0].width+6,document.images[0].height+54); ",
                     "window.focus();",
                   "} else { ",
                     "setTimeout('checksize()',250)",
                   " } }</"+"SCRIPT>"); 
w.document.write("<BODY onload='checksize()' onblur='window.close()' onclick='window.close()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
w.document.write("<TABLE width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><TR>");
w.document.write("<TD valign='middle' align='center'><IMG src='"+img+"' border=0 alt='Mon image'>"); 
w.document.write("</TD></TR></TABLE>");
w.document.write("</BODY></HTML>"); 
w.document.close(); 
} 

function dimens(image,w,h)
{
  var T = document.body.getElementsByTagName('H2')[0];
  T.innerHTML = 'Dimensions='+image.width+"x"+image.height+"px";
  image.width=w;
  image.height=h;
}

function ResizeImages(w,h)
{
/*  var P = document.getElementsByTagName('IMG');*/
/*  var P = document.getElementById('prise').getElementsByTagName('IMG');*/

  var P = document.body.getElementsByTagName('IMG');

  for(var i=0;i<P.length;i++)
  {
    if (P[i].width == 0)
    {
      /* Rechargement images non chargées */
      P[i].src=P[i].src;
    }
    if (P[i].width > 350)
    {
      /*P[i].onmouseover = function() { dimens(this, 400, 300); };*/
      P[i].onclick = function() { PopupImage(this.src); };
      P[i].width=350;
      P[i].height=230;
      P[i].style.cursor="pointer";
      P[i].style.border="1px solid blue";
      P[i].title="Cliquez pour agrandir";
    }
    else P[i].style.padding="1px";

/*    document.writeln ("Dimensions image ",i," : ",P[i].width,"x",P[i].height," px<br/>");*/
  }
}


