var bootSequence = new Array();

/* THIS FUNCTION IS NOT GENERAL ENOUGH!
 * IT ALL WORKS BECAUSE YOU'VE HACKED IT TOGETHER!
 * FIX IT! */

function findTarget(e) {
  var target;

  if (window.event && window.event.srcElement)
    target = window.event.srcElement;
  else if (e && e.target)
    target = e.target;

  if(!target) return null;

  while (target != document.body && target.nodeName.toLowerCase() != 'a')
    target = target.parentNode;

  if (target.nodeName.toLowerCase() != 'a')
    return null;

  return target;
}

function addToBoot(funcName) {
  bootSequence.push(funcName);
}

function boot() {
  for (x in bootSequence)
    bootSequence[x]();
}

window.onload = boot;
