/*
    Written by Dustin Diaz, http://www.dustindiaz.com
*/
var addListener = function() {
  if ( window.addEventListener ) {
    return function(el, type, fn) {
      el.addEventListener(type, fn, false);
    };
  } else if ( window.attachEvent ) {
    return function(el, type, fn) {
      var f = function() {
        fn.call(el, window.event);
      };
      el.attachEvent('on'+type, f);
    };
  } else {
    return function(el, type, fn) {
      element['on'+type] = fn;
    }
  }
}();