$(function(){
	
	$('#tabs_panels .tab:first').addClass('active');
	$('#tabs_panels .tab').click(function(){
		$('#tabs_panels .panel').hide();
		$('#panel_' + $(this).attr('id').replace('tab_', '')).show();
		
		$('#tabs_panels .tab').removeClass('active');
		$(this).addClass('active');
		
		return false
	})
	
	
})

/*
var TabPanel = Class.create({
    initialize: function(container, options)
    {
	    this.currentPanel = null;
	    this.currentTab = null;
	    this.container = container;

        if (!$(container)) {
            throw('El contenedor ' + container + ' no existe!');
            return false;
        }
      
        this.options = Object.extend({
            classNames : {
                tab : 'tab',
                panel : 'panel',
                link : 'tabpanel'
            }
        }, options || {});
        
        var tabs = $$('#' + container + ' .' + this.options.classNames.tab);
        
        tabs.each(function(tab) {
            Event.observe(tab, 'click', this.change.bind(this, tab), false);
            tab.onclick = function() {return false;};
        }.bind(this));

        var panels = $$('#' + container + ' .' + this.options.classNames.panel);
        panels.each(function(panel) {
        	panel.hide();
        });
    },

    change : function(newTab)
	{
    	newLink = newTab.className.replace('tab', '').replace('active', '').strip();
    	newPanel = $$('#' + this.container + ' .panels .' + newLink)[0];

    	if(this.currentTab)
    	{
        	currentLink = this.currentTab.className.replace('tab', '').replace('active', '').strip();
        	this.currentTab.toggleClassName('active');
        	this.currentPanel.hide();
    	}

    	newTab.toggleClassName('active');
    	newPanel.show();
	    this.currentTab = newTab;
	    this.currentPanel = newPanel;
    }
	
});
current_slide = "slide-1";
function changeSlide(slide)
{
	$(current_slide).hide();
	$(slide).show();
	current_slide = slide;
}

Event.observe(window, 'load', function()
{
					$$('#navbar .items DIV').each(function(link) {
				        Event.observe(link, 'mouseover', function(){
				        	link.addClassName('over');
				        });
				        Event.observe(link, 'mouseout', function(){
				        	link.removeClassName('over');
				        });
				    });

	tabpanel = new TabPanel('tabs_panels',{
	    classNames : {
	        tab : 'tab',
	        panel : 'panel',
	        link : 'tabpanel'
	    }
	});
	tabpanel.change($$('#tabs_panels .tabs .tabpanel_1')[0]);
});
*/
