/**
* Render a tabbed menu
 */
var tabids = [];
var containerids = [];
function create_tabs()
{
    $$('.tab').all( function( el ) {
            tabids.push( el.id );
            containerids.push( el.id.replace( 'tab_', '' ) );
            el.observe( 'click', handle_tab_click );
            return true;
    } );
}
/**
 * Hande a clicked tab
 */
function handle_tab_click( event )
{
    // Get container id
    containerid = this.id.replace( 'tab_', '' );
    // Set active tab menu point
   tabids.all( function( tab ) {
        $(tab).removeClassName( 'active' );
        return true;
    } );
    this.addClassName( 'active' );
    // Set active tab content container
    containerids.all( function( container ) {
        $(container).hide();
        return true;
    } );
    $(containerid).show();
}
/**
 * Init tabbing
 */
Event.observe( window, 'load', create_tabs );

