/*
Po-p-Up Script (c) 2002
CREATION DATE: 2002-08-24
LAST UPDATE:   2002-09-06
*/


/******************************************************************************
 Section 0.1: Détections!
******************************************************************************/

var isImg = document.images;
var isDOM = document.getElementById;
var isNS6 = (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko"));
var isOpera = (navigator.userAgent.indexOf ("Opera") != -1);


/******************************************************************************
 Section 3.1: Fenêtres surgissantes, convertis les ALT en Pop-Ups
******************************************************************************/
var altwidth = 150;

function createalt()
{
  if (isDOM && isImg)
    for (var i=0;i<document.images.length;i++) {
      if (document.images[i].alt) {
        document.images[i].id = "alt_" + i;
        var imgobj = document.getElementById (document.images[i].id);
        imgobj.altoldover = imgobj.onmouseover;
        imgobj.altoldout  = imgobj.onmouseout;
        imgobj.altoldmove = imgobj.onmousemove;
        imgobj.onmouseover = showalt;
        imgobj.onmouseout = hidealt;
        imgobj.onmousemove = movealt;

        if (isOpera) {
          var htmlcode = "<DIV CLASS='popupdiv' STYLE='left:0px;top:0px;' ID='pop_" + imgobj.id + "'>" + imgobj.alt + "</DIV>";
          document.write (htmlcode);
        } else {
          imgobj.alttext = imgobj.alt;
        }

        imgobj.alt = "";
      }
    }

  // Si ce n'est pas Opera, créer une fenêtre unique.
  if (!isOpera)
  {
    var htmlcode = "<DIV CLASS='popupdiv' STYLE='left:0px;top:0px;' ID='pop_all'></DIV>";
    document.write (htmlcode);
  }
}

function positionalt (winobj, e)
{
  var mx, my;
  if (isNS6)
  {
    mx = (e.pageX + 10);
    my = (e.pageY - 10);
  }
  else
  {
    if (isOpera)
    {
      mx = (e.clientX + 10);
      my = (e.clientY - 10);
    }
    else
    {
      mx = (e.clientX + document.body.scrollLeft + 10);
      my = (e.clientY + document.body.scrollTop - 10);
    }
  }
  with (winobj.style) {
    visibility = 'visible';
    left = mx + 'px';
    top = my + 'px';
  }
}

function showalt (e)
{
  var winobj = (isOpera) ? document.getElementById('pop_' + this.id) : document.getElementById('pop_all');
  if (!isNS6) e = event;

  if (!isOpera) winobj.innerHTML = this.alttext;

  positionalt (winobj, e);
  if (this.altoldover) this.altoldover ();
}

function movealt (e)
{
  var winobj = (isOpera) ? document.getElementById('pop_' + this.id) : document.getElementById('pop_all');
  if (!isNS6) e = event;

  positionalt (winobj, e);
  if (this.altoldmove) this.altoldmove ();
}

function hidealt ()
{
  var winobj = (isOpera) ? document.getElementById('pop_' + this.id) : document.getElementById('pop_all');

  with (winobj.style) {
    visibility = 'hidden';
  }
  if (this.altoldout) this.altoldout ();
}