function toggleListener(state, node, event, fn, mode){

    node[(state ? "add" : "remove") + "EventListener"](event, fn, mode || (mode === false) ? mode : true);
}
@param {boolean|undefined} state
@param {!Window|Document|Element} node
@param {string} event
@param {Function} fn
@param {EventListenerOptions|boolean=} mode