/*
Scripts du petit monde d'Émilie (c) 2002
CREATION DATE: 2002-07-21
LAST UPDATE:   2002-08-30
*/


/******************************************************************************
 Section 0.1: Détections!
******************************************************************************/

var isImg = document.images;
var isIEx = document.all;
var isDOM = document.getElementById;
var isNS6 = (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko"));
var isOpera = (navigator.userAgent.indexOf ("Opera") != -1);
var isBGSOUND = ((document.all) ? true : false);


/******************************************************************************
 Section 1.1: Roll-Overs animés
******************************************************************************/

// Création des images, si supporté
var rollover = new Array();

function createrollover (imgid, onsrc, offsrc, x, y) {
  rollover[imgid] = new Array();
  if (isImg) {
    rollover[imgid].imgOn = new Image (x,y);
    rollover[imgid].imgOn.src = onsrc;
    rollover[imgid].imgOff = new Image (x,y);
    rollover[imgid].imgOff.src = offsrc;
  }
  return false;
}

function roon  (imgid) { if (isImg) { document[imgid].src = rollover[imgid].imgOn.src; } }
function rooff (imgid) { if (isImg) { document[imgid].src = rollover[imgid].imgOff.src; } }


/******************************************************************************
 Section 2.1: Musique!
******************************************************************************/
function insertmusic (src) {
  if (isBGSOUND) {
    document.write ("<bgsound src='" + src +"' loop='infinite'/>");
  } else {
    html  = "<tr><td><img src='images/spixel.gif' width=127 height=15 border=0/><br/></td></tr>";
    html += "<tr><td align=center><embed src='";
    html += src;
    html += "' width=33 height=16/></td></tr>";
    document.write (html);
  }
}


/******************************************************************************
 Section 3.1: Quoi de neuf Pop-up!
******************************************************************************/
var popupoldload, popupinterval, newsobj;

function setpopup () {
  newsobj = document.getElementById ('newspopup');
  
  sizepopup();
  newsobj.style.visibility = 'visible';

  if (popupoldload) popupoldload();

  popupinterval = window.setInterval ("sizepopup()",100);
  window.setTimeout ("hidepopup()",8000);
}

function sizepopup()
{
  if (isNS6) {
    mx = (window.innerWidth - 335);
    my = (window.pageYOffset + 5);
  }
  else {
    if (isOpera)
      mx = (document.body.clientWidth - 320);
    else
      mx = (document.body.clientWidth - 305);
    my = (document.body.scrollTop + 5);
  }
  newsobj.style.left = mx + 'px';
  newsobj.style.top = my + 'px';
  newsobj.style.visibility = 'visible';
}
function hidepopup()
{
  window.clearInterval (popupinterval);
  newsobj.style.visibility = 'hidden';
  newsobj.style.display = 'none';
}
function gopopup () {
  if (isDOM)
  {
    popupoldload = window.onload;
    window.onload = setpopup;
  }
}


/******************************************************************************
 Section 3.2: Fenêtres Pop-Up!
******************************************************************************/
function popupemailform () {
  window.open( 'emailform.php', 'emailformwindow', "width=450,height=250,scrollbars=no,menubar=no,toolbar=no,location=no,status=no,resizable=no" );
}
function popupphoto (url, sizex, sizey)
{
  window.open('showimage.php?url='+url+'&sizex='+sizex+'&sizey='+sizey, '', "width=" + sizex + ",height=" + sizey + ",scrollbars=no,menubar=no,toolbar=no,location=no,status=no,resizable=no" );
}
function popupsondage () {
  window.open( 'sondage.php', 'sondagewindow', "width=350,height=350,scrollbars=yes,menubar=no,toolbar=no,location=no,status=no,resizable=no" );
}
