var bulle = false;
var bulleDiv = true;

/*********************
Fonction qui genere une
info bulle collée a la souris
**********************/
function infobulle(txt){
  if(txt!=''){
    if(bulleDiv){
      var div = document.createElement("div");
      div.innerHTML = txt;
      div.id = 'infobulle';
      div.style.position = "absolute";
      div.className = "infobulle";
      document.getElementsByTagName("body")[0].appendChild(div);
      bulleDiv = false;
      }else{
        document.getElementById('infobulle').innerHTML = txt;
        document.getElementById('infobulle').style.display = "block";
      }
      bulle = true;
    }
  }

  /*********************
  Fonction qui détruit
  l'info bulle collée a
  la souris
  **********************/
  function killinfobulle(){
    document.getElementById('infobulle').style.display = "none";
    bulle = false;
  }

  /*********************
  Fonction qui fait
  bouger la souris
  **********************/
  function MOUSEinfobulle(x,y){
    if(bulle){
      document.getElementById('infobulle').style.top = y-60+'px';
      document.getElementById('infobulle').style.left = x+15+'px';
    }
  }



/********************
  Fonction qui affiche
  et cache un bloc
  grace a son id !
  *********************/
  function view(id){
    if(document.getElementById(id).style.display=='none'){
      document.getElementById(id).style.display = 'block';
      }else{
        document.getElementById(id).style.display = 'none';
      }
    }
    
    var MOUSEX = 0;
var MOUSEY = 0;


function getPosition(p){
 var x = (navigator.appName.substring(0,3) == "Net") ? p.pageX : event.x-document.body.scrollLeft;
 var y = (navigator.appName.substring(0,3) == "Net") ? p.pageY : event.y-document.body.scrollTop;


/*Ca peut servir a nimporte qui !!!*/
MOUSEX = x;
MOUSEY = y;

	if(typeof(MOUSEinfobulle) == "function"){
  MOUSEinfobulle(x,y);
 }
}


if(navigator.appName.substring(0,3) == "Net"){
 document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = getPosition;


