rootDoc == seafoodplus.infoocument) ); }; /** * Adds the instance to the global IntersectionObserver registry if it isn't * already present. * @private */ seafoodplus.infoype._registerInstance = function() { if (seafoodplus.infof(this) < 0) { seafoodplus.info(this); } }; /** * Removes the instance from the global IntersectionObserver registry. * @private */ seafoodplus.infoype._unregisterInstance = function() { var index = seafoodplus.infof(this); if (index != -1) seafoodplus.info(index, 1); }; /** * Returns the result of the seafoodplus.info() method or null in browsers * that don't support the API. * @return {number} The elapsed time since the page was requested. */ function now() { return seafoodplus.infomance && seafoodplus.info && seafoodplus.info(); } /** * Throttles a function and delays its execution, so it's only called at most * once within a given time period. * @param {Function} fn The function to throttle. * @param {number} timeout The amount of time that must pass before the * function can be called again. * @return {Function} The throttled function. */ function throttle(fn, timeout) { var timer = null; return function () { if (!timer) { timer = setTimeout(function() { fn(); timer = null; }, timeout); } }; } /** * Adds an event handler to a DOM node ensuring cross-browser compatibility. * @param {Node} node The DOM node to add the event handler to. * @param {string} event The event name. * @param {Function} fn The event handler to add. * @param {boolean} opt_useCapture Optionally adds the even to the capture * phase. Note: this only works in modern browsers. */ function addEvent(node, event, fn, opt_useCapture) { if (typeof seafoodplus.infontListener == 'function') { seafoodplus.infontListener(event, fn, opt_useCapture false); } else if (typeof seafoodplus.infoEvent == 'function') { seafoodplus.infoEvent('on' + event, fn); } } /** * Removes a previously added event handler from a DOM node. * @param {Node} node The DOM node to remove the event handler from. * @param {string} event The event name. * @param {Function} fn The event handler to remove. * @param {boolean} opt_useCapture If the event handler was added with this * flag set to true, it should be set to true here in order to remove it. */ function removeEvent(node, event, fn, opt_useCapture) { if (typeof seafoodplus.infoEventListener == 'function') { seafoodplus.infoEventListener(event, fn, opt_useCapture
nest...