<!--
/**
 * Infos sur les variables
 *
 * MLwidth  : Largeur du conteneur
 * MLheight : Hauteur du conteneur
 * MLtop    : Position y du conteneur
 * MLleft   : Position x du conteneur
 * Mdecal   : Nb de pixels de décalage
 * Mspeed   : Fréquence entière en ms entre chaque décalage de Mdecal pixels
 * Mstr     : Le texte du scroll (HTML possible, faire attention aux caractères " et ')
 * Merr     : Message d'erreur si le navigateur n'est pas supporté.
 */

// Variables globales
//var Mloop = true;
//var Mvert = false;
//var Msens = -1;
var Mleft      = 0;
var Mtop       = 0;
var Mstrwidth  = 0;
var Mstrheight = 0;
var Merr       = '';
var MTimer;

// Détection du navigateur Opera.
function isOpera() {
  var strUserAgt = navigator.userAgent;
  var intUserAgt = strUserAgt.length;
  var intVersion = 0;
  var intStart;

  if ((intStart=strUserAgt.indexOf('Opera'))!=-1 ) {
    while(intStart < intUserAgt && isNaN(intVersion=parseInt(strUserAgt.charAt(intStart++))));
  }
  return intVersion;
}

// Détection du type de navigateur.
var ie4  = document.all && !document.getElementById;
var ns4  = document.layers;
var op5  = isOpera()==5;
var dom2 = document.getElementById;

// Démarrage, re-démarrage et arrêt du scroll.
function Mscroll(type) {
  if (type=='start') {MscrollIt(MLwidth);}			   // Démarrage
  else if (type=='continue') {MscrollIt(Mleft);}		   // Re-Démarrage
  else if (type=='stop') {if (MTimer!=null) clearTimeout(MTimer);} // Arrêt
}

// Initialisation
function MInit() {
  if (ns4) {
    // Taille du calque texte avec NS4.
    with (document.mrqDivCont) {
      Mstrwidth = document.Mdiv.document.width;
      Mstrheight = document.Mdiv.document.height;
      clip.width = MLwidth;
      clip.height = MLheight;
      hidden = false;
      y = MLtop;
      x = MLleft;
    }
  } else if (dom2 || ie4) {
    // Taille du calque qui contient le texte,
    var objText = dom2 ? document.getElementById('Mdiv'):document.all['Mdiv'];
    Mstrwidth = objText.offsetWidth;
    Mstrheight = objText.offsetHeight;
    objText.style.width = Mstrwidth + 'px';
    objText.style.height = Mstrheight + 'px';
    objText.style.top = Mtop + 'px';
    objText.style.left = Mleft + 'px';

    var objCont = dom2 ? document.getElementById('mrqDivCont'):document.all['mrqDivCont'];
    objCont.style.width = MLwidth + 'px';
    objCont.style.height = MLheight + 'px';
    objCont.style.left = MLleft + 'px';
    objCont.style.top = MLtop + 'px';
    objCont.style.clip = 'rect (0,' +  objCont.style.width + ', ' + objCont.style.height + ', 0)';
    objCont.style.visibility = 'visible';

  } else { // Non supporté
    if (Merr != '') { document.open(); document.write(Merr); document.close(); }
    return;
  }

  // Centrage du calque texte dans le conteneur.
  Mtop = (MLheight-Mstrheight) / 2;
  Mleft = (MLwidth-Mstrwidth) / 2;

  Mscroll('start');
}

// Cette fonction est chargée de faire défiler le calque
function MscrollIt(intTopLeft) {
  Mleft = intTopLeft - Mdecal;

  if (ns4) {
    var objText = document.mrqDivCont.document.Mdiv;
    objText.top = Mtop;
    objText.left = Mleft;
  } else {
    var objText = dom2 ? document.getElementById('Mdiv') : document.all['Mdiv'];
    objText.style.top = Mtop  + "px";
    objText.style.left = Mleft + "px";
  }

  // Test pour revenir au début
  if (Mleft <= -Mstrwidth) { Mleft = MLwidth; }

  // Timer si on est pas en bout de course
  if ((Mleft > -Mstrwidth) || (Mleft < MLwidth))
    MTimer = setTimeout("MscrollIt(" + Mleft + ")", Mspeed);
}

document.open();
document.write('<style type="text/css">');
document.write('#mrqDivCont { position: absolute; overflow: hidden; visibility: hidden; }');
document.write('#Mdiv, mrqNS4DivText { position: relative; width: 1px; height: 1px; top: 0px; left: 0px;');
document.write('</style>');

// Utilisation d'un <layer> pour NS4 et d'un <span> pour IE
document.write('<div id="mrqDivCont" z-index:0 width="' + MLwidth + '" height="' + MLheight + '">');
if (ns4) {
  document.write('<layer name="Mdiv" z-index:0 class="mrqNS4DivText" onMouseOver="Mscroll(\'stop\');" onMouseOut="Mscroll(\'continue\');">');
  document.write('<nobr>' + Mstr + '</nobr>');
  document.write('</layer>');
} else {
  document.write('<font color="#000000"><span id="Mdiv" z-index:0 onMouseOver="Mscroll(\'stop\');" onMouseOut="Mscroll(\'continue\');">');
  document.write('<nobr>' + Mstr + '</nobr>');
  document.write('</span></font>');
}
document.write('</div>');
document.close();

/* onLoad de la fonction MInit()
 *
 * On utilise de préférence l'eventListener pour éviter le bug de NS6, NS6.01 qui "ignore" la
 * ligne window.onLoad = fonction().
*/ 
if (window.addEventListener && !ns4) { Window.addEventListener('load', MInit, false); }
else { window.onLoad = MInit(); }

//-->
