if(!tc){ var tc = {}; }
  
  tc.quotes = function(app,options){
    var _me = this;
    
    function lengthClasser(text, threshold) {
      if (text.length > (threshold || 120)) {
        return "long";
      }
      return "";
    }
    
    this.initialize = function(){
      tc.util.log('quotes.initialize');
      _me.index = 1;
      _me.viz_index = 1;
      _me.dom = app.Y.one(options.selector);
      _me.blockquotes = _me.dom.all('blockquote');
      options.data.sort(function(){return 0.5 - Math.random();});
      setTimeout(_me.cycle,options.timeout);
      return _me;
    }
    
    this.cycle = function(){
      tc.util.log('quotes.cycle');
      var animIn, animOut, quoteContent;
      
      quoteContent = options.data[_me.index].content + "";
      if(!quoteContent){
        _me.index = _me.index + 1;
        if(_me.index > options.data.length -1){
          _me.index = 0;
        }
        _me.cycle();
        return;
      }
      
      _me.blockquotes._nodes[_me.viz_index].innerHTML = "";
      _me.blockquotes._nodes[_me.viz_index].innerHTML = 
        '<p><span class="quote opener">&#147;</span>'+
          '<span class="text ' + lengthClasser(quoteContent) + '">'+
            quoteContent+
            '<span class="quote closer">&#148;</span>\
          </span>\
        </p>';
      _me.blockquotes._nodes[_me.viz_index].innerHTML = _me.blockquotes._nodes[_me.viz_index].innerHTML + '<cite>&ndash; '+options.data[_me.index].author+'</cite>';
      
       animIn = new app.Y.Anim({
         node: _me.blockquotes._nodes[_me.viz_index],
         to: {
           opacity: 1.0
         }
       });
       
       animOut = new app.Y.Anim({
         node: _me.blockquotes._nodes[_me.viz_index === 1 ? 0 : 1],
         to: {
           opacity: 0.0
         }
       });
       
       animOut.on('end', function() {
         setTimeout(_me.cycle,options.timeout);
       });
      
      animIn.run();
      animOut.run();
      
      _me.index = _me.index + 1;
      if(_me.index > options.data.length -1){
        _me.index = 0;
      }
      _me.viz_index = _me.viz_index + 1;
      if(_me.viz_index > 1){
        _me.viz_index = 0;
      }
      
    }
    
    return this.initialize();
  }
