function elementScroller(element) {
  return {
    /**
     * @return {Number} the scroll height of the element in pixels
     */
    scrollHeight: function() {
      return Math.max(
        element.scrollHeight,
        element.offsetHeight,
        element.clientHeight
      );
    },

    /**
     * @return {Number} the height of the element in pixels
     */
    height: function() {
      return Math.max(element.offsetHeight, element.clientHeight);
    },

    /**
     * Gets the Y scroll position
     * @return {Number} pixels the element has scrolled along the Y-axis
     */
    scrollY: function() {
      return element.scrollTop;
    }
  };
}
Gets the Y scroll position
@return {Number} pixels the page has scrolled along the Y-axis