  //____________________________________________________________
  //                                              scrollImgDsDiv
  // positionne une image contenue dans une div (bouge ascenseur)
  // ex: scrollDiv('bas droit');    //positionne en bas à droite
  // ex: scrollDiv('haut gauche');  //positionne en haut à gauche
  // ex: scrollDiv('centreV');      //centre verticalement
  // ex: scrollDiv('centreH');      //centre horizontalement
  //____________________________________________________________
  function scrollImgDsDiv(position,id)
  {
    if (document.getElementById)
    { //__fonction getElementById existe, OK
    
      position=position.toUpperCase();
      
      img = document.getElementById(id);
      div = img.parentNode;
      
      //alert(position.indexOf('BAS'));
      hauteurImg=img.clientHeight;
      largeurImg=img.clientWidth;
      if (position.indexOf('HAUT')>-1)    div.scrollTop  = 0;
      if (position.indexOf('DROIT')>-1)   div.scrollLeft = largeurImg;
      if (position.indexOf('BAS')>-1)     div.scrollTop  = hauteurImg;
      if (position.indexOf('GAUCHE')>-1)  div.scrollLeft = 0;
      //___centreV
      if (position.indexOf('CENTREV')>-1)
      {
        largeurDiv=div.offsetHeight;
        hauteurDiv=div.offsetWidth;
        //alert('hauteurImg='+hauteurImg+', largeurImg='+largeurImg+', hauteurDiv='+hauteurDiv+', largeurDiv='+largeurDiv);
        if (hauteurImg > hauteurDiv)  div.scrollTop=(hauteurImg-hauteurDiv)/2;
      }
      //___centreH
      if (position.indexOf('CENTREH')>-1)
      {
        largeurDiv=div.offsetHeight;
        hauteurDiv=div.offsetWidth;
        //alert('hauteurImg='+hauteurImg+', largeurImg='+largeurImg+', hauteurDiv='+hauteurDiv+', largeurDiv='+largeurDiv);
        if (largeurImg > largeurDiv) div.scrollLeft=(largeurImg-largeurDiv)/2;
      }
    }
    else alert('fonction getElementById existe pas , Err..');
  }
  //____________________________________________________________
  //                                                      montre
  // fonctions elementaires pour manipuler les calques
  // rends visible
  //____________________________________________________________
  function montre(id)
  {
  	  if (document.getElementById) { document.getElementById(id).style.visibility="visible";	}
  	  else if (document.all)       { document.all[id].style.visibility="visible"; }
  	  else if (document.layers)    { document.layers[id].visibility="visible";	}
  } 
  //____________________________________________________________
  //                                                       cache
  // rends invisible
  //____________________________________________________________
  function cache(id)
  {  
  	  if (document.getElementById) { document.getElementById(id).style.visibility="hidden"; }
  	  else if (document.all)       { document.all[id].style.visibility="hidden"; }
  	  else if (document.layers)    { document.layers[id].visibility="hidden"; }
  }
  //____________________________________________________________
  //                                                 montreCache
  // propriete visible pilotée par une case à cocher
  // <input type="checkbox" name="chkb" onClick="montreCache(this,'img1');" value="fond" checked>Fond carte<br>
  //____________________________________________________________
  function montreCache(obj,id)
  {
    if(obj.checked) montre(id);
               else cache(id);
  }
  //____________________________________________________________
  //                                                    cocheInit
  //  Qd on rafraichit (F5), les coches gardent leurs anciennes valeurs !
  //  Il faut donc les forcer ds le <body onLoad="cocheInit();"> 
  // <input type="checkbox" name="chkb" value="fond" checked>Fond carte
  //____________________________________________________________
  function cocheInit(chkbName)
  {
    //alert(window.document.getElementsByName(chkbName)[0].value);
    var obj = document.getElementsByName(chkbName);
    //alert(obj[0].value+'='+obj[0].checked+', '+obj[1].value+'='+obj[1].checked+', '+obj[2].value+'='+obj[2].checked);
    obj[0].checked=false;  //première case à cocher
    obj[1].checked=false;
    obj[2].checked=false;
  }
  
  //---test le navigateur-->true si firefox
  //  La gestion est différente selon le navigateur
  //  window.Event pour firefox (avec un E majuscule)
  //  sinon window.event   (avec un e minuscule)
  var firefox = (window.Event)? true : false;
  
  
  //____________________________________________________________
  //                                                   showThumb 
  // non --> affiche l'image url, positionnée par rapport a objSrc (this) //l'objet générant l'evt
  // comme ne marche pas pour les zones d'image mappée on affiche l'image url a la position (left,top)
  // --->Il faut une div en position absolue :
  // <head><style> #divId1{ position: absolute; } </style></head>
  // ---> un texte est une image ds une DIV :
  // <div id="divId1"><font>Legende</font><img id="imgId1"></div>
  // ---> ex: déclenchement de l'evt sur un lien
  // <a onmouseover="showThumb(this,'divId1','imgId1','BELL.GIF',left,top);" onmouseout="hideThumb('divId1');" href="BELL.GIF">Bell</a>
  //____________________________________________________________
  function showThumb(objSrc,divId,imgId,imgUrl)
  {
     var txt='divId='+divId+', imgId='+imgId+', imgUrl='+imgUrl;
     //window.status=txt;
     //alert(txt);    
     
     var image=new Image();
     image.src=imgUrl;

     document.getElementById(imgId).src=image.src;

     //__on peut changer la couleur du texte
     //maFont=document.getElementsByTagName('font')[0];
     //maFont.color='red';

     var obj = document.getElementById(divId);
     obj.style.visibility='visible';

     //__image positionné par rapport a l'objet ayant généré l'evt (this) ==> objSrc
     //obj.style.top =objSrc.offsetTop +30;
     //obj.style.left=objSrc.offsetLeft+10;
     
     // fonctionne pour un DIV ou SPAN ou P mais pas pas pour une zone d'image mappée (AREA shape..)
     // donc on utilise x,y (left,top)
     //obj.style.top =top;
     //obj.style.left=left;
     
     //window.status='divId='+divId+', imgId='+imgId+', top='+objSrc.offsetTop+', left='+objSrc.offsetLeft;
  }
  //____________________________________________________________
  //                                                   hideThumb
  // cache la divId (l'image)
  // <a onmouseover="showThumb('divId1','imgId1','BELL.GIF');" onmouseout="hideThumb('divId1');" href="BELL.GIF">Bell</a>
  // <div id="divId1"><font>Legende</font><img id="imgId1"></div>
  //____________________________________________________________
  function hideThumb(divId)
  {
     window.document.getElementById(divId).style.visibility='hidden';
  }
  //____________________________________________________________
  //                                                     moveDiv
  // positionne la div a la position (left,top)
  // <a onmousemove="movediv('divId1',100,200);" href="CD.GIF">CD</a>
  // <div id="divId1"><font>Legende</font><img id="imgId1"></div>
  //____________________________________________________________
  function moveDiv(divId,left,top)
  {
    var obj=document.getElementById(divId);
    obj.style.left=left+'px';
    obj.style.top =top+'px';
    //window.status='divId='+divId+', left='+left+', top='+top;
  }
  //____________________________________________________________
  //                                    sourisCoordonneesAffiche
  //____________________________________________________________
  function sourisCoordonneesAffiche(e)
  {
    //window.status='==>'+e;
  
    if (navigator.appName.substring(0,3) == "Net")
    { //firefox
      var x   = e.pageX;
      var y   = e.pageY;
      var src = e.srcElement;
      var tag = e.tagName;
    }
    else
    { //IE
      var x   = event.x+document.body.scrollLeft;
      var y   = event.y+document.body.scrollTop;
      var src = document.getElementById('divId1').srcElement;
      var tag = document.getElementById('divId1').tagName;
    }
    var xConteneur = document.getElementById('entete').scrollLeft+9;
    var yConteneur = document.getElementById('entete').offsetHeight+9;
    //window.status='X='+xConteneur +' Y='+yConteneur;
    
    var scrollLeft= document.getElementById('divIdFond').scrollLeft;
    var scrollTop = document.getElementById('divIdFond').scrollTop;
    //window.status='X='+scrollLeft +' Y='+scrollTop;
   
    x = x-xConteneur+scrollLeft;
    y = y-yConteneur+scrollTop;
   
    //window.status='X='+x +' Y='+y;
  }
  //____________________________________________________________
  //                                           sourisCoordonnees                         
  // affiche coordonnees souris
  //____________________________________________________________
  function sourisCoordonnees()
  {
    document.onmousemove = sourisCoordonneesAffiche;
  }
  //____________________________________________________________
  //                                                     areaOut
  //____________________________________________________________
  function areaOut()
  {
    /*hideThumb('divIdProfil');*/
    hideThumb('divIdRefugeVignetteSC');
  }
  //____________________________________________________________
  //                                                    areaOver
  //  affiche image du troncon survolé
  //  affiche image du profil
  //  cache aprés 3 secondes
  //____________________________________________________________
  function areaOver(objSrc,divIdTroncon,imgIdTroncon,urlTroncon,leftTroncon,topTroncon,aHref,divIdProfil,imgIdProfil,urlProfil,leftProfil,topProfil)
  {
    //over();
    // affiche troncon survolé
    //alert('divIdProfil='+divIdProfil+', imgIdProfil='+imgIdProfil+', urlProfil='+urlProfil+', leftProfil='+leftProfil+', topProfil='+topProfil+', divIdTroncon='+divIdTroncon+', imgIdTroncon='+imgIdTroncon+', urlTroncon='+urlTroncon+', leftTroncon='+leftTroncon+', topTroncon='+topTroncon);
/*
    document.getElementById('divIdTroncon').parentNode.href=aHref;
    showThumb(0,divIdTroncon,imgIdTroncon,urlTroncon);
    moveDiv(divIdTroncon,leftTroncon,topTroncon);
*/
    
    //affiche image profil altitude (du troncon survolé)
    showThumb(0,divIdProfil,imgIdProfil,urlProfil);
    moveDiv(divIdProfil,leftProfil,topProfil);
    
    
    //annule et réactive timeout de 3"
    try
    {
      if (timerOut) { clearTimeout(timerOut); }
    } catch(e) {}

    timerOut=setTimeout('areaOut()', 3000);   //3 secondes
    //alert(timerOut);
  }
  //____________________________________________________________
  //                                                     areaOut
  //____________________________________________________________
  function overRefugeOut() {  hideThumb('divIdRefugeVignetteSC'); }
  //____________________________________________________________
  //                                                  overRefuge
  //  affiche image du vignette du refuge survolé
  //  cache aprés 3 secondes
  //____________________________________________________________
  function overRefuge(divIdProfil,imgIdProfil,leftProfil,topProfil,urlProfil)
  {
    try{  console.debug('divIdProfil='+divIdProfil+',imgIdProfil='+imgIdProfil+',leftProfil='+leftProfil+',topProfil='+topProfil+',urlProfil='+urlProfil);  } catch(error) {}
    //affiche image profil altitude (du troncon survolé)
//alert('divIdProfil='+divIdProfil+', imgIdProfil='+imgIdProfil+', leftProfil='+leftProfil+', topProfil='+topProfil+', urlProfil='+urlProfil);
    showThumb(0,divIdProfil,imgIdProfil,urlProfil);
    moveDiv(divIdProfil,leftProfil,topProfil);

    //annule et réactive timeout de 3"
    try
    {
      if (timerOut) { clearTimeout(timerOut); }
    } catch(e) {}
    timerOut=setTimeout('overRefugeOut()', 3000);   //3 secondes
    //alert(timerOut);
  }
  //____________________________________________________________
  //                                                     showImg
  //  <div..><a><img..></a></div>   //OK sous IE et Firefox
  //  marche pas sous IE si balise A englobe la div !
  //____________________________________________________________
  function showImg(imgId,imgUrl,left,top,aHref)
  {
    //alert('imgId='+imgId+', imgUrl='+imgUrl+', left='+left+', top='+top+', aHref='+aHref);
    
    var image=new Image();
    image.src=imgUrl;
    var obj=document.getElementById(imgId);  //___l'image
    obj.src=image.src;    //l'image
    
    obj=obj.parentNode;   //____la balise A contenant l'image
    obj.href=aHref;       //change URL
    
    obj=obj.parentNode;   //____la div contenant l'image
    obj.style.visibility='visible';
    obj.style.left=left+'px';  //sans px marche sous firefox mais pas sous IE
    obj.style.top =top+'px';

  }
  //____________________________________________________________
  //____________________________________________________________
  function popup(page)
  {
    var w=window.open(page,"pop1","width=330,height=150");
    w.focus();
  }
  //____________________________________________________________
  //                                               afficheResume
  //____________________________________________________________
  function afficheResume(idRefuge, pathImg, lien)
  {
    try{  console.debug(idRefuge+', '+pathImg+', '+lien);  } catch(error) {}
    
    idId = 'resumeRefuge' + idRefuge;
    idImg = 'imgresumeRefuge' + idRefuge;
    idAncient = 'resumeRefuge' + ancienRefuge;
    
    document.getElementById(idImg).src = pathImg;
    document.getElementById(idId).style.display = 'block';   
    
    try
    {
      document.getElementById(idAncient).style.display = 'none';  
    }
    catch (error)
    {
      try{  console.debug(idAncient);  } catch(error) {}
    }
    ancienRefuge = idRefuge;
  }
  //____________________________________________________________
  //____________________________________________________________
