function enableTooltips(id) {
  var links, i, h;
  if (!document.getElementById || !document.getElementsByTagName) {
    return;
  }
  h = document.createElement("span");
  h.id = "btc";
  h.setAttribute("id", "btc");
  h.style.position = "absolute";
  h.style.zIndex = '1000';
  document.getElementsByTagName("body")[0].appendChild(h);
  if (id == null) {
    links = document.getElementsByTagName("a");
  } else {
    links = document.getElementById(id).getElementsByTagName("a");
  }
  for (i = 0; i < links.length; i++) {
    Prepare(links[i])
  }
}

function Prepare(el) {
  var tooltip, t, b, s, l;
  t = el.getAttribute("title");
  if (!(t == null || t.length == 0)) {
    t = t.toString().replace(/\[/ig, '<').replace(/\]/ig, '>');
    el.removeAttribute("title");
    el.getElementsByTagName("img")[0].removeAttribute("alt");
    tooltip = CreateEl("span", "tooltip");
    tooltip.style.position = 'relative';
    tooltip.style.zIndex = '1000';
    s = CreateEl("span", "top");
    var oDiv = document.createElement("div");
    s.appendChild(oDiv);
    oDiv.innerHTML = t;
    oDiv.style.backgroundColor = 'rgb(239,239,239)';
    oDiv.style.zIndex = '1000';
    oDiv.style.position = 'relative';
    tooltip.appendChild(s);
    b = CreateEl("b", "bottom");
    b.style.position = 'relative';
    b.style.zIndex = '1000';
    if (navigator.appName == "Microsoft Internet Explorer" && (navigator.appVersion.indexOf("MSIE 7.0") ==- 1)) {
      var iframe = document.createElement('<iframe width="200" frameborder="no" src="about:blank"></iframe>');
      iframe.style.position = 'absolute';
      iframe.style.top = '22px';
      iframe.style.left = '0px';
      iframe.style.width = '200px';
      iframe.style.zIndex = '100';
      tooltip.appendChild(iframe)
    }
    tooltip.appendChild(b);
    el.tooltip = tooltip;
    el.onmouseover = showTooltip;
    el.onmouseout = hideTooltip;
    el.onmousemove = Locate;
  }
}

function showTooltip(e) {
  var objects = document.getElementsByTagName("object");
  /*for (i = 0; i < objects.length; i++) {
    objects[i].style.visibility = 'hidden'
  }*/
  document.getElementById("btc").appendChild(this.tooltip);
  Locate(e)
}

function hideTooltip(e) {
  var objects = document.getElementsByTagName("object");
  for (i = 0; i < objects.length; i++) {
    objects[i].style.visibility = 'visible'
  }
  var d = document.getElementById("btc");
  if (d.childNodes.length > 0) {
    d.removeChild(d.firstChild);
  }
}

function CreateEl(t, c) {
  var x = document.createElement(t);
  x.className = c;
  x.style.display = "block";
  return (x)
}

function Locate(e) {
  var posx = 0, posy = 0;
  if (e == null) {
    e = window.event;
  }
  if (e.pageX || e.pageY) {
    posx = e.pageX;
    posy = e.pageY
  } else if (e.clientX || e.clientY) {
    if (document.documentElement.scrollTop) {
      posx = e.clientX + document.documentElement.scrollLeft;
      posy = e.clientY + document.documentElement.scrollTop
    } else {
      posx = e.clientX + document.body.scrollLeft;
      posy = e.clientY + document.body.scrollTop;
    }
  }
  var innerWidth, innerHeight;
  if (self.innerHeight) {
    innerWidth = self.innerWidth;
    innerHeight = self.innerHeight
  } else if (document.documentElement && document.documentElement.clientHeight) {
    innerWidth = document.documentElement.clientWidth;
    innerHeight = document.documentElement.clientHeight
  } else if (document.body) {
    innerWidth = document.body.clientWidth;
    innerHeight = document.body.clientHeight
  }
  var x, y;
  if (self.pageYOffset) {
    x = self.pageXOffset;
    y = self.pageYOffset
  } else if (document.documentElement && document.documentElement.scrollTop) {
    x = document.documentElement.scrollLeft;
    y = document.documentElement.scrollTop
  } else if (document.body) {
    x = document.body.scrollLeft;
    y = document.body.scrollTop
  }
  if ((posx + 180) > (x + innerWidth)) {
    posx = x + innerWidth - 200
  }
  if ((posy + document.getElementById("btc").offsetHeight) > (y + innerHeight)) {
    posy = posy - document.getElementById("btc").offsetHeight - 20
  }
  if (navigator.appName == "Microsoft Internet Explorer" && (navigator.appVersion.indexOf("MSIE 7.0") ==- 1)) {
    if (document.getElementById("btc").getElementsByTagName("iframe")[0]) {
      document.getElementById("btc").getElementsByTagName("iframe")[0].style.height = (document.getElementById("btc").offsetHeight - 22) + "px"
    }
  }
  document.getElementById("btc").style.top = (posy + 10) + "px";
  document.getElementById("btc").style.left = (posx - 20) + "px"
}

