if(!tc){ var tc = {}; }
  
  tc.anchor_scroller = function(app,options){
    var _me = this;
    
    this.initialize = function(){
      tc.util.log('anchor_scroller.initialize');
      _me.page = app.Y.one('.page');
      _me.atags = app.Y.all('a');
      _me.atags.each(function(node){
        var split = node.getAttribute('href').split('#');
        if(split.length == 2){
          node.on('click',_me.anchorClickedHandler);
        }
      });
      _me.anim = new app.Y.Anim({
        node: app.Y.one('#wrapper'),
        duration: 0.6,
        easing: app.Y.Easing.easeBothStrong
      });
      _me.atags = null;
      return _me;
    }
    
    _me.anchorClickedHandler = function(event){
      var target;
      event.preventDefault();
      _me.scroll_to(event.target.getAttribute('href').split('#')[1])
    }
    
    _me.scroll_to = function(id){
      var target;
      target = app.Y.one('#'+id);
      if(target){
        _me.anim.set('to', { scroll: [target.get('docScrollX'), (target.getY() - _me.page.getY())] });
        _me.anim.on('end',function(){
          //window.location.hash = event.target.getAttribute('href').split('#')[1];
        });
        _me.anim.run();
      }
    }
    
    return this.initialize();
    
  }
