<!--
// bulles.js
// (c)BEP CONCEPT - FRANCE
// Eric Pasquier - December 2009
//----------------------------


//============================
// addEvent
//----------------------------
function addEvent(elm, evType, fn, useCapture)
{
  if (elm.addEventListener) {
    elm.addEventListener(evType, fn, useCapture);
    return true;
  }
  else if (elm.attachEvent) {
    var r = elm.attachEvent('on' + evType, fn);
    return r;
  }
  else {
    elm['on' + evType] = fn;
  }
}

//============================
// affichePopup
//----------------------------
function affichePopup(Pid)
{
  var div = document.getElementById(Pid);
  if (!div)
    return;
  div.style.display = "block";
}

//============================
// hidePopup
//----------------------------
function hidePopup(Pid)
{
  var div = document.getElementById(Pid);
  if (!div)
    return;
  div.style.display = "none";
}

//============================
// affichePopupLeft
//----------------------------
function affichePopupLeft()
{
  affichePopup("bulle_left");
}

//============================
// hidePopupLeft
//----------------------------
function hidePopupLeft()
{
  hidePopup("bulle_left");
}

//============================
// affichePopupCenter
//----------------------------
function affichePopupCenter()
{
  affichePopup("bulle_center");
}

//============================
// hidePopupCenter
//----------------------------
function hidePopupCenter()
{
  hidePopup("bulle_center");
}

//============================
// affichePopupRight
//----------------------------
function affichePopupRight()
{
  affichePopup("bulle_right");
}

//============================
// hidePopupRight
//----------------------------
function hidePopupRight()
{
  hidePopup("bulle_right");
}

//============================
// bullesInitLeft
// Associe 
//----------------------------
function bullesInitLeft()
{
  var div = document.getElementById("personnages_left");
  var a = div.getElementsByTagName("a");
  addEvent(a[0], "mouseover", affichePopupLeft, true);
  addEvent(a[0], "mouseout", hidePopupLeft, false);
}

//============================
// bullesInitCenter
// Associe 
//----------------------------
function bullesInitCenter()
{
  var div = document.getElementById("personnages_center");
  var a = div.getElementsByTagName("a");
  addEvent(a[0], "mouseover", affichePopupCenter, true);
  addEvent(a[0], "mouseout", hidePopupCenter, false);
}

//============================
// bullesInitRight
// Associe 
//----------------------------
function bullesInitRight()
{
  var div = document.getElementById("personnages_right");
  var a = div.getElementsByTagName("a");
  addEvent(a[0], "mouseover", affichePopupRight, true);
  addEvent(a[0], "mouseout", hidePopupRight, false);
}


//============================
// bullesInit
// Associe 
//----------------------------
function bullesInit()
{
  bullesInitLeft();
  bullesInitCenter();
  bullesInitRight();
}

//============================
// main
//----------------------------
addEvent(window, 'load', bullesInit, true);

//-->

