function cal_popup(ctrl) {
//alert(ctrl);
  var cal_fr = document.getElementById("cal_fr");
  if (cal_fr == null) {
    cal_fr = document.createElement("div");
    cal_fr.style.position = "absolute";
    //cal_fr.style.backgroundColor = "red";
    cal_fr.className="mgs_menu_titre";
    cal_fr.id = "cal_fr";
    cal_fr.active = true;
    cal_fr.style.left = 0;
    cal_fr.style.top = 0;

    var link = document.createElement("a");
    cal_fr.appendChild(link);
    link.appendChild(document.createTextNode("Close / Fermer"));
    link.href="javascript:cal_disappear()";
    var root = ctrl.parentNode.parentNode;
    var first = root.firstChild;
    root.insertBefore(cal_fr, first);

    var iframe = document.createElement("iframe");
    iframe.src = ctrl.href.toString();
    iframe.height = "300px";
    iframe.width = "225px";
    iframe.style.margin = 0;
    cal_fr.appendChild(iframe);
    cal_fr.onmouseover = cal_popup(null);
    cal_fr.onmouseout = cal_popout(null);
  }
  else {
    cal_fr.style.visible = true;
    cal_fr.active = true;
    cal_fr.style.display = "";  
    cal_fr.toRemove = false;
  }
}

function cal_disappear() {
  var cal_fr = document.getElementById("cal_fr");
  if (cal_fr != null && cal_fr.active && cal_fr.toRemove) {
    cal_fr.active = false;
    cal_fr.style.visible = false;
    cal_fr.style.display = "none";
    cal_fr.toRemove = false;
  }
}

function cal_popout(ctrl) {
//alert(ctrl);
  var cal_fr = document.getElementById("cal_fr");
  cal_fr.toRemove = true;
  //setTimeout("cal_disappear()", 3000);
}
