
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

var SelItem = 1


function Tableau(n)
{
  this.length=n;
  return this;
}


function MM_goToURL() { //v2.0
  for (var i=0; i< (MM_goToURL.arguments.length - 1); i+=2) //with arg pairs
    eval(MM_goToURL.arguments[i]+".location='"+MM_goToURL.arguments[i+1]+"'");
  document.MM_returnValue = false;
}


//onload="chargeimages('boutons/btn_bleu.gif','boutons/btn_vert.gif','boutons/btn_rouge.gif')"
function chargeimages()
{
  if (document.images)
  {
    var Args = chargeimages.arguments;  // les arguments sont les noms des images à charger
    if (document.preloadArray==null) document.preloadArray = new Array();
    var i = document.preloadArray.length;
    with (document)
      for (var j=0; j<Args.length; j++)
        if (Args[j].charAt(0)!="#")
        {
          preloadArray[i] = new Image;
          preloadArray[i].src = Args[j];
          i++;
        }
  }
}


function changeimage(imageno,objetimage)
{
 window.document.images[imageno].src = objetimage.src;
}


function changeimagemenu(menunum)
{
  if( SelItem!=menunum)
    changeimage(menunum*2, document.preloadArray[1]);
}

function restoreimagemenu(menunum)
{
  if( SelItem!=menunum)
  {
    changeimage(menunum*2, document.preloadArray[0]);
}
  else
    setimagemenu(menunum);
}

function setimagemenu(menunum)
{
  changeimage(menunum*2, document.preloadArray[2]);
}


function SelectMenu(MenuNum)
{
  var OldSelItem=SelItem;
  SelItem=MenuNum;
  setimagemenu(MenuNum);
  restoreimagemenu(OldSelItem);
}




function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}



function PopupImage(img, texte) {
  titre="Am&eacute;lie de Montard - Perles d'Art";
  w=open("",'image','width=500,height=500,toolbar=no,scrollbars=no,resizable=yes,status=no,left=165,top=40');
  w.document.write("<html><head><title>"+titre+"</title>");
  w.document.write("<link rel='stylesheet' href='../perles.css' type='text/css'>");
  w.document.write("<"+"script language=java"+"script> function checksize()");
  w.document.write("{ if (document.images['img'].complete) {  window.resizeTo(document.images[0].width+50,document.images[0].height+120); window.focus();} else { setTimeout('checksize()',250) } }" );
  w.document.write("</"+"script></head>");
  w.document.write("<body onload='checksize()' onClick='this.close()' bgcolor='#000000' leftMargin=20 topMargin=20 marginwidth=20 marginheight=20>");
  w.document.write("<img src='"+img+"' border=0 name='img'>");
  w.document.write("<center>");
  w.document.write("<p class='imgSubTitle'>");
  w.document.write( texte );
  w.document.write("</p>");
  w.document.write("</center>");
  w.document.write("");
  w.document.write("</body></html>");
  w.document.close();
}

function popupDef( pageLocation, aHeight )
{
  window.open(pageLocation,'Definitions','width=620,height='+aHeight+',screenX=100,screenY=100,dependent=yes,resizable=no');
}

