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).removeClass('open');
            $(this).addClass('close');
        }
    });
}

$(document).ready( function() {
    $('#yurts_in_mongolia').hide();
    $('#yurt_history').hide();
	$('.supporting_images').hide();
	$('#our_yurts_images').show();

    $('#our_yurts_link').click(function() {
        if($(this).hasClass('open') == false) {
            $(this).removeClass('close');
            $(this).toggleClass('open');
            hide_topics();
			$('.supporting_images').hide();
			$('#our_yurts').show();
			$('#our_yurts_images').show();
        }
        remove_classes('our_yurts');
    });

    $('#yurts_in_mongolia_link').click(function() {
        if($(this).hasClass('open') == false) {
            $(this).removeClass('close');
            $(this).toggleClass('open');
            hide_topics();
			$('.supporting_images').hide();
			$('#yurts_in_mongolia').show();
			$('#mongolia_image').show();
        }
        remove_classes('yurts_in_mongolia');
    });

    $('#yurt_history_link').click(function() {
        if($(this).hasClass('open') == false) {
            $(this).removeClass('close');
            $(this).toggleClass('open');
            hide_topics();
			$('.supporting_images').hide();
            $('#yurt_history').show();
			$('#yurt_history_image').show();
        }
        remove_classes('yurt_history');
    });
});