var bars = new Class({
  Implements: [Events, Options],  
    options: {
      containerHeight: 323,
      containerWidth: 320
    },
    initialize: function(container){
      var params = Array.link(arguments, {'options': Object.type, 'element': $defined});
      this.setOptions(params.options || { });
      this.container = $(container);
      this.items = this.container.getChildren();
      this.navBar = this.items[0];
      this.content = this.items[1];
      
      this.initFilterButtons();
    },
    initFilterButtons: function(){
      this.content.getChildren()[0].setStyles({'left': 0, 'top': 0});
      this.navBar.getChildren().each(function(items,index){
        items.addEvent('click', function(e){
          if(items.hasClass('color')){
            this.addColor();
            items.toggleClass('color');
            items.toggleClass('selected');
            this.content.getChildren()[0].tween('left', -index*this.options.containerWidth);
          };
          e.stop();
        }.bind(this));
      }.bind(this));
    },
    addColor: function(){
      this.navBar.getChildren().each(function(item){
        item.addClass('color');
        if(item.hasClass("selected")) item.toggleClass("selected");
      });
    }
});