var current_sport = 'all';
var sports        = [ 'tenisz', 'futball', 'kezilabda' ];
function switch_sport( target )
{
    if( current_sport != target )
    {
        $( current_sport + '_switch' ).removeClassName( 'aktiv' );
        $( target + '_switch' ).addClassName( 'aktiv' );
        if( current_sport != 'all' )
        {
            if ( $(current_sport + '_menetrend' ) )
            {
                $( current_sport + '_menetrend' ).addClassName( 'hidden_sport' );
                $( current_sport + '_menetrend_bottom' ).addClassName( 'hidden_sport' );
            }
        }
        if( target != 'all' )
        {
            if ( $( target + '_menetrend' ) ) 
            {
                $( target + '_menetrend' ).removeClassName( 'hidden_sport' );
                $( target + '_menetrend_bottom' ).removeClassName( 'hidden_sport' );
            }
            for( i = 0; ln = sports.length, i < ln; i++ )
            {
                if( sports[ i ] == target ) $$( '.' + sports[ i ] ).each( function( item ) { item.show(); } );
                else $$( '.' + sports[ i ] ).each( function( item ) { item.hide(); } );
            }
        }
        else $$( '.' + sports.implode( ',.' ) ).each( function( item ) { item.show(); } );
        current_sport = target;
    }
}

