	/*****************************************************************************
	The sIFR configuration should typically go in `sifr-config.js`, but in order to
	keep the config file clean, and to give a quick overview, it's done here instead.
	*****************************************************************************/



	juliaKlein = {};

	juliaKlein.initSifr = function(){

		var gothamBold = { src: 'wp-content/themes/juliaklein/media/fonts/gothamSubset.swf' };

		// You probably want to switch this on, but read <http://wiki.novemberborn.net/sifr3/DetectingCSSLoad> first.
		sIFR.useStyleCheck = true;

		sIFR.activate( gothamBold );
		
//		sIFR.debug.ratios({ src: 'wp-content/themes/juliaklein/media/fonts/gothamSubset.swf', selector: '#sidebar h3' });

		sIFR.replace( gothamBold, {
			selector: '#sidebar h3',
			css: [ '.sIFR-root { color:#999999 }' ],
			forceSingleLine: true,
			wmode: "transparent",
			ratios:[6, 1.24, 11, 1.13, 12, 1.12, 21, 1.07, 29, 1.04, 30, 1.05, 49, 1.03, 53, 1.02, 54, 1.03, 74, 1.02, 77, 1.01, 78, 1.02, 83, 1.01, 84, 1.02, 89, 1.01, 90, 1.02, 95, 1.01, 96, 1.02, 1.01]
		});
		
		
		sIFR.replace( gothamBold, {
			selector: 'h5.entry-date',
			css: [ '.sIFR-root { color: #aaaaaa }' ],
			fitExactly: true,
			forceWidth: true,
			preventWrap: true,
			fixWrap: true,
			wmode: "transparent",
			ratios:[6, 1.24, 11, 1.13, 12, 1.12, 21, 1.07, 29, 1.04, 30, 1.05, 49, 1.03, 53, 1.02, 54, 1.03, 74, 1.02, 77, 1.01, 78, 1.02, 83, 1.01, 84, 1.02, 89, 1.01, 90, 1.02, 95, 1.01, 96, 1.02, 1.01]
		});

		sIFR.replace( gothamBold, {
			selector: '.page-title',
			css: [ '.sIFR-root { color: #aaaaaa }' ],
			fitExactly: true,
			forceWidth: true,
			preventWrap: true,
			fixWrap: true,
			wmode: "transparent",
			ratios:[6, 1.24, 11, 1.13, 12, 1.12, 21, 1.07, 29, 1.04, 30, 1.05, 49, 1.03, 53, 1.02, 54, 1.03, 74, 1.02, 77, 1.01, 78, 1.02, 83, 1.01, 84, 1.02, 89, 1.01, 90, 1.02, 95, 1.01, 96, 1.02, 1.01]
		});

	}

	Rot13 = {
		convert : function( aString ){
	    	return aString.replace( /[a-zA-Z]/g, function( c ){
	        	return String.fromCharCode( ( c <= "Z" ? 90 : 122 ) >= ( c = c.charCodeAt(0) + 13) ? c : c - 26 );
	    	});
		}
	};
	
	window.addEvent( 'domready', function(){
		var emailLinks = $$( ".emailLink a" );
		if( !emailLinks.length ) return;
		var archiveTitle = $$( ".archiveTitle")[0];
		if( archiveTitle ){
			var monthString = archiveTitle.getElement("span").get( "text" );
			var archiveLIs = $( "archiveList" ).getElements("li");
			archiveLIs.each( function( anLI ){
				if( anLI.getElement("a").get("text") == monthString ){
					anLI.addClass("current-cat");
				}
			});
		}
		emailLinks.each( function( anElement ){
			anElement.set( "text", Rot13.convert( anElement.get( "text" ) ) );
			anElement.set( "href", Rot13.convert( anElement.get( "href" ) ) );
		});
		juliaKlein.initSifr();
	});
