// <![CDATA[
$(document).ready(function() {
	$('#formButton').hide();
	sIFR.replaceElement('#content>h1,#content>h2', named({sFlashSrc: '/f/journal.swf', sColor: '#145f35', sBgColor: '#f3f3ef', swMode: 'transparent'}));
	sIFR.replaceElement('.bullets>h2', named({sFlashSrc: '/f/journal.swf', sColor: '#145f35', sBgColor: '#dae1d3', swMode: 'transparent'}));
	sIFR.replaceElement('#content>form>h2, #content>#articles>h1', named({sFlashSrc: '/f/journal.swf', sColor: '#145f35', sBgColor: '#dae1d3', swMode: 'transparent'}));
	sIFR.replaceElement('#subSection>h1', named({sFlashSrc: '/f/journal.swf', sColor: '#145f35', sBgColor: '#dae1d3', swMode: 'transparent'}));
	sIFR.replaceElement('#subSectionDark>h1', named({sFlashSrc: '/f/journal.swf', sColor: '#145f35', sBgColor: '#B0C7B7', swMode: 'transparent'}));

	$('#imgSwap a[rel=swap]').click(function() {
		/* Replace "small" with "main" for CMS pages. */
		var thumbSrc = $(this).children('img').attr('src').replace('-thumb', '-large').replace('small', 'main');
		if($('#imgMain').attr('src') != thumbSrc) {
			$('#imgMain').fadeOut('slow', function() {
				/* Preload the image before making the switch */
				var img = new Image;
				img.src = thumbSrc;
				img.onload = function() {
					$('#imgMain').attr('src', thumbSrc).fadeIn('slow');
				}
			});
		}

		return false;
	});
});
// ]]>