// Pré-téléchargement des images
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i]}
  }
}

// Affichage du lien "Haut de page"
/***********************************************
* Script adapted from :
* Jump To Top Link Script- © Dynamic Drive (www.dynamicdrive.com)
* Last updated Nov 13th, 03'.
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var displayed="<img src='images/top_page.png' width='12' height='13' border='0'>"
var link='javascript:window.scrollTo(0,0)'
var ie4=document.all
var ns6=document.getElementById&&!document.all

function ietruebody() {
  return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
  }

function afficheTop() {
  document.write('<span id="gotop" style="position:absolute;visibility:hidden;top:-300px;z-index:100">'+displayed+'</span>')
}

function staticit() {
  var w2=ns6? pageXOffset+w : ietruebody().scrollLeft+w
  var h2=ns6? pageYOffset+h : ietruebody().scrollTop+h
  crossgotop.style.left=w2+"px"
  crossgotop.style.top=h2+"px"
}

function inserttext() {
  crossgotop=document.getElementById("gotop")
  crossgotop.innerHTML='<a href="'+link+'">'+displayed+'</a>'
  var position = crossgotop.offsetWidth/2
  width = ns6 || window.opera ? window.innerWidth - 17 : ietruebody().clientWidth
  height = ns6 || window.opera ? window.innerHeight : ietruebody().clientHeight
  w = width < 1024 ? width - 40 : width/2 + 512 - 32
  h = height-crossgotop.offsetHeight - 15
  crossgotop.style.left=w+"px"
  crossgotop.style.top=h+"px"
  if (document.body.scrollHeight > 981) crossgotop.style.visibility="visible" // Displays icone only if page is longer than a minimum
  else return
  if (ie4)
    window.onscroll=staticit
  else if (ns6)
    startstatic=setInterval("staticit()",100)
}

if (window.addEventListener) // Firefox,Opera & Safari
  window.addEventListener("load", inserttext, false)
else if (window.attachEvent) // ?
  window.attachEvent("onload", inserttext)
else // IE
  window.onload=inserttext

// La fonction suivante est utilisée par les version IE <=8
// Elle est vide sauf pour IE6 dans menu.js
function montre(id,affiche) {

  return;
}
