code: function createEvent(name) {
      var event = void 0;
      if (typeof document !== 'undefined') {
          event = document.createEvent('HTMLEvents') || document.createEvent('event');
          event.initEvent(name, false, true);
      }
      return event;
  }
docs: Creates a new event and initalizes it.
  
  @param {String} name
  @returns {Event}