/**
 * Attaches a function to an event
 *
 * @param obj   The actual object to attach event listener function to. (e.g., window, etc.)
 * @param ev    A string representation of the event, without the "on" prefix. (e.g., "load", "click", etc.)
 * @param func  The function reference to call upon event triggering
 */
function safe_addEventListener(obj, ev, func) {
  if (obj.addEventListener) {
    obj.addEventListener(ev, func, false);
  }
  else if (obj.attachEvent) {
    obj.attachEvent("on" + ev, func);
  }
}


