if(!tc){ var tc = {}; }
  
  tc.searchform = function(app,options){
    var _me = this;
    
    this.initialize = function(){
      tc.util.log('searchform.initialize');
      if(options.selector){
        _me.dom = app.Y.one(options.selector);
        _me.dom.one('.btn-wrapper').on('click',function(e){
          if(_me.submitHandler && typeof _me.submitHandler == 'function'){
            _me.submitHandler(e);
          } else {
            _me.submit();
          }
        });
        _me.searchinput = _me.dom.one('input[type=text]');
        _me.searchinput.on('keypress',function(e){
          if(e.which === 13){
            e.preventDefault();
            if(_me.submitHandler && typeof _me.submitHandler == 'function'){
              _me.submitHandler(e);
            } else {
              _me.submit();
            }
          }
        });
      }
      
      return _me;
    }
    
    this.submit = function(){
      _me.dom.submit();
    }
    
    this.get_input = function(){
      return _me.searchinput;
    }
    
    return this.initialize();
  }
