(function () {
	var currentDirection,
		currentOffset,
		previousDirection,
		previousOffset = window.pageYOffset,
		scrollDownEvent,
		scrollUpEvent,
		scrollDownStartEvent,
		scrollUpStartEvent;

	// Initialize events
	try {
		scrollDownEvent = new Event('scrolldown');
		scrollUpEvent = new Event('scrollup');
		scrollDownStartEvent = new Event('scrolldownstart');
		scrollUpStartEvent = new Event('scrollupstart');
	} catch (e) {
		// No browser support for Event constructor, use
		// the old-fashioned way :(

		scrollDownEvent = document.createEvent('Event');
		scrollUpEvent = document.createEvent('Event');
		scrollDownStartEvent = document.createEvent('Event');
		scrollUpStartEvent = document.createEvent('Event');

		scrollDownEvent.initEvent('scrolldown', true, true);
		scrollUpEvent.initEvent('scrollup', true, true);
		scrollDownStartEvent.initEvent('scrolldownstart', true, true);
		scrollUpStartEvent.initEvent('scrollupstart', true, true);
	}

	function onScroll(event) {
		currentOffset = window.pageYOffset;

		// Determine the current scroll direction
		if (currentOffset < previousOffset) {
			currentDirection = 'up';
		} else if (currentOffset > previousOffset) {
			currentDirection = 'down';
		} else {
			currentDirection = undefined;
		}

		// Has the scroll direction changed since the last scroll?
		if (currentDirection !== previousDirection) {
			if (currentDirection === 'up') {
				window.dispatchEvent(scrollUpStartEvent);
			} else if (currentDirection === 'down') {
				window.dispatchEvent(scrollDownStartEvent);
			}
		}

		if (currentDirection === 'up') {
			window.dispatchEvent(scrollUpEvent);
		} else if (currentDirection === 'down') {
			window.dispatchEvent(scrollDownEvent);
		}

		previousDirection = currentDirection;
		previousOffset = currentOffset;
	}

	window.addEventListener('scroll', onScroll, false);
})();

@@ -956,16 +956,119 @@
 e);%0A%09%7D%0A%0A
+%09/**%0A%09 * Trigger additional scroll events.%0A%09 *%0A%09 * @param Event  event  The original scroll event%0A%09 */%0A
 %09functio

Add some minor code documentation.