  window.onload = function() {
    ButtonImage('to-be-fixed');
  };

  function ButtonImage(id) {
    if (!document.getElementsByTagName) return;
    var tbf = document.getElementById(id);
    if (!tbf) return;
    for (var i=0; i<tbf.getElementsByTagName('input').length; i++) {
      var inp = tbf.getElementsByTagName('input')[i];
      inp.className = 'be-gone';
      inp.id = 'random-id-' + i;
      var img = document.createElement('img');
      img.setAttribute('src', defaultPath + 'img/buttons/application_' + inp.getAttribute('value').toLowerCase() + '.png');
      img.setAttribute('alt', inp.getAttribute('value'));
      var a = document.createElement('a');
      a.appendChild(img);
      a.setAttribute('title', inp.getAttribute('value'));
      a.setAttribute('href', '#');
      a.associatedControl = 'random-id-' + i;
      a.onclick = function() {
        document.getElementById(this.associatedControl).click();
        return false;
      }
      tbf.appendChild(a);
    }
  }
