﻿$(function() {
// Hide tab content.
$('.tab-content').hide();

$('#tabs a').html('');

// Show content for active tab.
$('#tabs a.active').each(function() {
	$('#' + $(this).attr('id') + '-content').show();
});

$('#tabs a').click(function() {
	if ($(this).hasClass('active')) {
		return false;
	}

	// Deactivate active tab.
	$('#tabs a').removeClass('active');
	$('.tab-content').hide();

	// Activate this tab.
	$(this).addClass('active');
	$('#' + $(this).attr('id') + '-content').show();

	return false;
});

// Add padding to the text-side of aligned images.
$('img[@align=left]').css('margin-right', '2em');
$('img[@align=right]').css({
	'margin-left': '2em',
	'margin-right': '1em'
});

});