var Tabs = new Class({
	Implements: [Events, Options],
    initialize: function(options){
        this.setOptions(options);
        this.buttons = this.options.tabs.getChildren();
        this.containers = this.options.content.getElements('.tabContent');
        this.hideAllContentBlocks();
        this.init();
    },
    
    init: function(){
        // set initial
		this.showContent(this.buttons[0], 0);
        this.buttons.each(this.clickTab.bind(this));
    },
    parentInit: function(){
    
    },
    clickTab: function(el, i){
        el.addEvent('click', this.showContent.pass([el, i], this))
    },
    showContent: function(el, i){
        this.activeTab(el);
        this.hideAllContentBlocks();
        this.containers[i].setStyle('display', 'block');
    },
    activeTab: function(el){
        this.buttons.each(function(x){
            x.removeClass('active');
        })
        el.addClass('active');
    },
    hideAllContentBlocks: function(){
        this.containers.each(function(el){
            el.setStyle('display', 'none')
        });
    }
});
Tabs.implement(new Events, new Options);