function hide_topics() {
    $('.about_topic').hide();
}

function remove_classes(id_to_protect) {
    id_to_protect += '_link';
    $('.about_tab').each( function() {
        if($(this).attr('id') != id_to_protect) {
            $(this).addClass('close');
            $(this).removeClass('open');
        }
    });
}

$(document).ready( function() {
    $('#our_pledge').hide();
    $('#testimonials').hide();
    $('#venues').hide();

    $('#introduction_link').click(function() {
        if($(this).hasClass('open') == false) {
            $(this).removeClass('close');
            $(this).toggleClass('open');
            hide_topics();
            $('#introduction').show();
        }
        remove_classes('introduction');
    });

    $('#our_pledge_link').click(function() {
        if($(this).hasClass('open') == false) {
            $(this).removeClass('close');
            $(this).toggleClass('open');
            hide_topics();
            $('#our_pledge').show();
        }
        remove_classes('our_pledge');
    });

    $('#testimonials_link').click(function() {
        if($(this).hasClass('open') == false) {
            $(this).removeClass('close');
            $(this).toggleClass('open');
            hide_topics();
            $('#testimonials').show();
        }
        remove_classes('testimonials');
    });

    $('#venues_link').click(function() {
        if($(this).hasClass('open') == false) {
            $(this).removeClass('close');
            $(this).toggleClass('open');
            hide_topics();
            $('#venues').show();
        }
        remove_classes('venues');
    });

});