function styleObjet(objet) {
 if (document.getElementById && document.getElementById(objet)) {
  return document.getElementById(objet).style
 }
 if (document.all && document.all(objet)) {
  return document.all(objet).style
 }
 if (document.layers && document.layers[objet]) {
  return document.layers[objet]
 }
 else {
  return false
 }
}

function voirDetails(v) {
 styleObjet(v).display=(styleObjet(v).display=='block') ? 'none' : 'block'
// styleObjet(v).display='block'
}

function forcerVoirDetails(v) {
 styleObjet(v).display='block'
}

function cacherDetails(v) {
 styleObjet(v).display='none'
}

var IB=new Object
var posX=0;posY=0
var xOffset=10;yOffset=10

function AffBulle(texte) {
 contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"><TR bgcolor='"+IB.ColContour+"'><TD><TABLE border=0 cellpadding=4 cellspacing=0 bgcolor='"+IB.ColFond+"'><TR><TD><FONT size='-1' face='trebuchet, arial' style='font-size:11px' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;"
 var finalPosX=posX-xOffset
 if (finalPosX<0) finalPosX=0
 if (document.layers) {
  document.layers["bulle"].document.write(contenu)
  document.layers["bulle"].document.close()
  document.layers["bulle"].top=posY+yOffset
  document.layers["bulle"].left=finalPosX
  document.layers["bulle"].visibility="show"
 }
 if (document.all) {
  bulle.innerHTML=contenu
  document.all["bulle"].style.top=posY+yOffset
  document.all["bulle"].style.left=finalPosX
  document.all["bulle"].style.visibility="visible"
 }
 else if (document.getElementById) {
  document.getElementById("bulle").innerHTML=contenu
  document.getElementById("bulle").style.top=posY+yOffset
  document.getElementById("bulle").style.left=finalPosX
  document.getElementById("bulle").style.visibility="visible"
 }
}

function AffBullePerso(texte) {
 contenu="<table border=0 cellspacing=0 cellpadding=1><tr bgcolor=#f29317><td><table border=0 cellpadding=4 cellspacing=0 bgcolor=#011d26><tr><td><font size='-1' face='trebuchet, arial' style='font-size:12px' color=#ffffff>"+texte+"</font></td></tr></table></td></tr></table>&nbsp;"
 var finalPosX=posX-xOffset
 if (finalPosX<0) finalPosX=0
 if (document.layers) {
  document.layers["bulle"].document.write(contenu)
  document.layers["bulle"].document.close()
  document.layers["bulle"].top=posY+yOffset
  document.layers["bulle"].left=finalPosX
  document.layers["bulle"].visibility="show"
 }
 if (document.all) {
  bulle.innerHTML=contenu
  document.all["bulle"].style.top=posY+yOffset
  document.all["bulle"].style.left=finalPosX
  document.all["bulle"].style.visibility="visible"
 }
 else if (document.getElementById) {
  document.getElementById("bulle").innerHTML=contenu
  document.getElementById("bulle").style.top=posY+yOffset
  document.getElementById("bulle").style.left=finalPosX
  document.getElementById("bulle").style.visibility="visible"
 }
}

function AffBulleAccueil(texte) {
 xOffset=250;yOffset=10
 contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"><TR bgcolor='#ffffff'><TD><TABLE border=0 cellpadding=4 cellspacing=0 bgcolor='#000000'><TR><TD><FONT size='-1' face='trebuchet, arial' style='font-size:11px' color='#ffffff'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;"
 var finalPosX=posX-xOffset
 if (finalPosX<0) finalPosX=0
 if (document.layers) {
  document.layers["bulle"].document.write(contenu)
  document.layers["bulle"].document.close()
  document.layers["bulle"].top=posY+yOffset
  document.layers["bulle"].left=finalPosX
  document.layers["bulle"].visibility="show"
 }
 if (document.all) {
  bulle.innerHTML=contenu
  document.all["bulle"].style.top=posY+yOffset
  document.all["bulle"].style.left=finalPosX
  document.all["bulle"].style.visibility="visible"
 }
 else if (document.getElementById) {
  document.getElementById("bulle").innerHTML=contenu
  document.getElementById("bulle").style.top=posY+yOffset
  document.getElementById("bulle").style.left=finalPosX
  document.getElementById("bulle").style.visibility="visible"
 }
}

function AffBulleArme(texte) {
 xOffset=250;yOffset=10
 contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"><TR bgcolor='#ff0000'><TD><TABLE border=0 cellpadding=4 cellspacing=0 bgcolor='#ffff00'><TR><TD><FONT size='-1' face='trebuchet, arial' style='font-size:11px' color='#ffffff'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;"
 var finalPosX=posX-xOffset
 if (finalPosX<0) finalPosX=0
 if (document.layers) {
  document.layers["bulle"].document.write(contenu)
  document.layers["bulle"].document.close()
  document.layers["bulle"].top=posY+yOffset
  document.layers["bulle"].left=finalPosX
  document.layers["bulle"].visibility="show"
 }
 if (document.all) {
  bulle.innerHTML=contenu
  document.all["bulle"].style.top=posY+yOffset
  document.all["bulle"].style.left=finalPosX
  document.all["bulle"].style.visibility="visible"
 }
 else if (document.getElementById) {
  document.getElementById("bulle").innerHTML=contenu
  document.getElementById("bulle").style.top=posY+yOffset
  document.getElementById("bulle").style.left=finalPosX
  document.getElementById("bulle").style.visibility="visible"
 }
}

function AffBulleMaru(texte) {
 contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"><TR bgcolor='#F8B839'><TD><TABLE border=0 cellpadding=4 cellspacing=0 bgcolor='#FACD7B'><TR><TD><FONT size='-1' face='trebuchet, arial' style='font-size:11px' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;"
 var finalPosX=posX-xOffset
 if (finalPosX<0) finalPosX=0
 if (document.layers) {
  document.layers["bulle"].document.write(contenu)
  document.layers["bulle"].document.close()
  document.layers["bulle"].top=posY+yOffset
  document.layers["bulle"].left=finalPosX
  document.layers["bulle"].visibility="show"
 }
 if (document.all) {
  bulle.innerHTML=contenu
  document.all["bulle"].style.top=posY+yOffset
  document.all["bulle"].style.left=finalPosX
  document.all["bulle"].style.visibility="visible"
 }
 else if (document.getElementById) {
  document.getElementById("bulle").innerHTML=contenu
  document.getElementById("bulle").style.top=posY+yOffset
  document.getElementById("bulle").style.left=finalPosX
  document.getElementById("bulle").style.visibility="visible"
 }
}

function AffBulleDamas(texte) {
 contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"><TR bgcolor='#F08635'><TD><TABLE border=0 cellpadding=4 cellspacing=0 bgcolor='#FACD7B'><TR><TD><FONT size='-1' face='trebuchet, arial' style='font-size:11px' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;"
 var finalPosX=posX-xOffset
 if (finalPosX<0) finalPosX=0
 if (document.layers) {
  document.layers["bulle"].document.write(contenu)
  document.layers["bulle"].document.close()
  document.layers["bulle"].top=posY+yOffset
  document.layers["bulle"].left=finalPosX
  document.layers["bulle"].visibility="show"
 }
 if (document.all) {
  bulle.innerHTML=contenu
  document.all["bulle"].style.top=posY+yOffset
  document.all["bulle"].style.left=finalPosX
  document.all["bulle"].style.visibility="visible"
 }
 else if (document.getElementById) {
  document.getElementById("bulle").innerHTML=contenu
  document.getElementById("bulle").style.top=posY+yOffset
  document.getElementById("bulle").style.left=finalPosX
  document.getElementById("bulle").style.visibility="visible"
 }
}

function AffBulleComposite(texte) {
 contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"><TR bgcolor='#EA5D32'><TD><TABLE border=0 cellpadding=4 cellspacing=0 bgcolor='#FACD7B'><TR><TD><FONT size='-1' face='trebuchet, arial' style='font-size:11px' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;"
 var finalPosX=posX-xOffset
 if (finalPosX<0) finalPosX=0
 if (document.layers) {
  document.layers["bulle"].document.write(contenu)
  document.layers["bulle"].document.close()
  document.layers["bulle"].top=posY+yOffset
  document.layers["bulle"].left=finalPosX
  document.layers["bulle"].visibility="show"
 }
 if (document.all) {
  bulle.innerHTML=contenu
  document.all["bulle"].style.top=posY+yOffset
  document.all["bulle"].style.left=finalPosX
  document.all["bulle"].style.visibility="visible"
 }
 else if (document.getElementById) {
  document.getElementById("bulle").innerHTML=contenu
  document.getElementById("bulle").style.top=posY+yOffset
  document.getElementById("bulle").style.left=finalPosX
  document.getElementById("bulle").style.visibility="visible"
 }
}

function AffBulleTrempeArgile(texte) {
 contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"><TR bgcolor='#B0CF6C'><TD><TABLE border=0 cellpadding=4 cellspacing=0 bgcolor='#CBE0A7'><TR><TD><FONT size='-1' face='trebuchet, arial' style='font-size:11px' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;"
 var finalPosX=posX-xOffset
 if (finalPosX<0) finalPosX=0
 if (document.layers) {
  document.layers["bulle"].document.write(contenu)
  document.layers["bulle"].document.close()
  document.layers["bulle"].top=posY+yOffset
  document.layers["bulle"].left=finalPosX
  document.layers["bulle"].visibility="show"
 }
 if (document.all) {
  bulle.innerHTML=contenu
  document.all["bulle"].style.top=posY+yOffset
  document.all["bulle"].style.left=finalPosX
  document.all["bulle"].style.visibility="visible"
 }
 else if (document.getElementById) {
  document.getElementById("bulle").innerHTML=contenu
  document.getElementById("bulle").style.top=posY+yOffset
  document.getElementById("bulle").style.left=finalPosX
  document.getElementById("bulle").style.visibility="visible"
 }
}

function AffBulleGauche(texte) {
 contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"><TR bgcolor='"+IB.ColContour+"'><TD><TABLE border=0 cellpadding=4 cellspacing=0 bgcolor='"+IB.ColFond+"'><TR><TD><FONT size='-1' face='arial' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;"
 var finalPosX=posX-xOffset-150
 if (finalPosX<0) finalPosX=0
 if (document.layers) {
  document.layers["bulle"].document.write(contenu)
  document.layers["bulle"].document.close()
  document.layers["bulle"].top=posY+yOffset
  document.layers["bulle"].left=finalPosX
  document.layers["bulle"].visibility="show"
 }
 if (document.all) {
  bulle.innerHTML=contenu
  document.all["bulle"].style.top=posY+yOffset
  document.all["bulle"].style.left=finalPosX
  document.all["bulle"].style.visibility="visible"
 }
 else if (document.getElementById) {
  document.getElementById("bulle").innerHTML=contenu
  document.getElementById("bulle").style.top=posY+yOffset
  document.getElementById("bulle").style.left=finalPosX
  document.getElementById("bulle").style.visibility="visible"
 }
}

function getMousePos(e) {
 if (document.all) {
  posX=event.x+document.body.scrollLeft
  posY=event.y+document.body.scrollTop
 }
 else {
  posX=e.pageX
  posY=e.pageY 
 }
}

function HideBulle() {
 if (document.layers) {document.layers["bulle"].visibility="hide";}
 if (document.all) {document.all["bulle"].style.visibility="hidden";}
 else if (document.getElementById){document.getElementById("bulle").style.visibility="hidden";}
}

function InitBulle(ColTexte,ColFond,ColContour,NbPixel) {
 IB.ColTexte=ColTexte;IB.ColFond=ColFond;IB.ColContour=ColContour;IB.NbPixel=NbPixel;
 if (document.layers) {
  window.captureEvents(Event.MOUSEMOVE);window.onMouseMove=getMousePos;
  document.write("<LAYER name='bulle' top=0 left=0 visibility='hide'></LAYER>");
 }
 if (document.all) {
  document.write("<DIV id='bulle' style='position:absolute;top:0;left:0;visibility:hidden;z-index:10'></DIV>");
  document.onmousemove=getMousePos;
 }
 else if (document.getElementById) {
  document.onmousemove=getMousePos;
  document.write("<DIV id='bulle' style='position:absolute;top:0;left:0;visibility:hidden;z-index:10'></DIV>");
 }
}

var DHTML=(document.getElementById || document.all || document.layers);
function ap_getObj(name) { 
 if (document.getElementById) {
  return document.getElementById(name).style
 } 
 else
  if (document.all) {
   return document.all[name].style
  } 
  else 
   if (document.layers) {
    return document.layers[name]
   } 
} 

function ap_showWaitMessage(div,flag)  {
 if (!DHTML) return
 var x = ap_getObj(div); x.visibility = (flag) ? 'visible':'hidden'
 if(! document.getElementById) 
  if(document.layers) 
   x.left=235
 return true
}

ap_showWaitMessage('waitDiv', 1)

function ouvrirIndexAlphabetique(chemin) {
 if (chemin!="") {
  document.location=chemin
 }
}

function effet(image){
 if(image && image.filters && image.filters[0]){
  image.filters[0].apply();
  image.filters[0].play();
 }
}

// Lien fixe en bas à droite : retour en haut de la page
var tjs_delai=0;
var tjs_max=3000;
var tjs_mode=1; // 0 - calque toujours en haut de page / 1 - calque en bas

var tjs_hauteur=0;
function PrintCalque(left,top,width,height,contenu) {
 tjs_hauteur=height;
 if ((document.all)||(document.getElementById)) {
  var Z="<DIV id='tomber' style='position:absolute;left:"+left+";top:"+top+";width:"+width+";height:"+height+"'>"+contenu+"</DIV>";
 } else {
  var Z="<LAYER name='tomber' left="+left+" top="+top+" width="+width+" height="+height+">"+contenu+"</LAYER>";
 }
 document.write(Z);
 setTimeout("Start()",tjs_delai);
}
function Start() {
 MoveLayer("tomber",GetTop("tomber"));
 setTimeout("Start()",tjs_delai);
}
function Debug() {
 var obj=document.body
 var Z="";
 for (var i in obj) {
  Z+=i+"="+obj[i]+"\n";
 }
 alert(Z);
}
function MoveLayer(nom,top) {
 if (document.getElementById) {
  document.getElementById(nom).style.top=top;
 }
 if ((document.all)&&(!document.getElementById)) {
  document.all[nom].style.top=top;
 }
 if (document.layers) {
  document.layers[nom].top=top;
 }
}

function GetTop(nom) {
 if (document.getElementById) {
  var pos=parseInt(document.getElementById(nom).style.top);
  var wintop=parseInt(document.body.scrollTop);
  var avail=document.body.clientHeight;
 }
 if ((document.getElementById)&&(!document.all)) {
  var pos=parseInt(document.getElementById(nom).style.top);
  var wintop=parseInt(window.pageYOffset);
  var avail=window.innerHeight;
 }
 if ((document.all)&&(!document.getElementById)) {
  var pos=parseInt(document.all[nom].style.top);
  var wintop=parseInt(document.body.scrollTop);
  var avail=document.body.clientHeight;
 }
 if (document.layers) {
  var pos=parseInt(document.layers[nom].top);
  var wintop=parseInt(window.pageYOffset);
  var avail=window.innerHeight;
 }

 if (tjs_mode==0) {
  var delta=Math.ceil((pos-wintop)/3);
  if (delta>tjs_max) {delta=tjs_max;}
  if (delta<-1*tjs_max) {delta=-1*tjs_max;}
  var top=pos-delta;
 }
 if (tjs_mode==1) {
  var delta=Math.ceil((pos-(wintop+avail-tjs_hauteur)));
  if (delta>tjs_max) {delta=tjs_max;}
  if (delta<-1*tjs_max) {delta=-1*tjs_max;}
  var top=pos-delta;
 }
 return top;
}

