(function() {
  

  var Dom = YAHOO.util.Dom;
  var Lang = YAHOO.lang;
  
  var PageScroll = function(to, duration, easing) {
    
    var el = null;
    
    // TODO: support passing of element as argument
    
    var attributes = {
      'scroll': {
        from: Dom.getDocumentScrollTop(),
        to: to
      }
    };
    
    PageScroll.superclass.constructor.call(this, el, attributes, duration, easing);

    this.setAttribute = function(attribute, value, units) {
      window.scroll(0, value);
    };

  };
  
  Lang.extend(PageScroll, YAHOO.util.Anim);
  
  // Add PageScroll to TIME.util namespace
  window.TIME = window.TIME || YAHOO.namespace('TIME');
  YAHOO.namespace('TIME.util');
  TIME.util.PageScroll = PageScroll;
  
})();
