if(!tc){ var tc = {}; }
  
  tc.autocomplete = function(app,options){
    var _me = this;
    this.ac = null;
    
    this.initialize = function(){
      tc.util.log('autocomplete.initialize');
      if(!app.searchform){
        return false;
      }
      
      //app.Y.one('body').addClass('yui3-skin-sam');
      
      _me.ac = new app.Y.AutoComplete({
        inputNode:app['searchform'].get_input(),
        resultHighlighter: 'charMatch',
        resultFilters: ['startsWith','charMatch'],
        render:true,
        maxResults:10,
        source: options.source
      });
      
      _me.ac.on('select',function(e){
        if(app.anchor_scroller){
          app.anchor_scroller.scroll_to(e.result.raw.replace(' ',''));
        }
      });
      
      app['searchform'].submitHandler = function(e){
        if(app.anchor_scroller){
          app.anchor_scroller.scroll_to(e.target._node.value.replace(' ',''));
        }
      }
      
      return _me;
    }
    
    return this.initialize();
  }
