function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function prepareHints() {
  var tags = document.getElementsByTagName("a");
  for (var i=0; i<tags.length; i++){
    if (tags[i].parentNode.getElementsByTagName("span")[0]) {
      tags[i].onclick = function () {
        this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
        return false; // this should prevent opening of the new window if clicked
      }
      tags[i].onfocus = function () {
        this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
      }
      tags[i].onblur = function () {
        this.parentNode.getElementsByTagName("span")[0].style.display = "none";
      }
    }
  }
}

addLoadEvent(prepareHints);
