	/*****************************************************************************
	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.
	*****************************************************************************/

	var chalet = { src: 'media/fonts/chalet.swf' };

	var chaletLondon1960 = { src: 'media/fonts/chaletLondon1960.swf' };

	var chaletNY1960 = { src: 'media/fonts/chaletNY1960.swf' };

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

	gastronomisti = {};
	gastronomisti.initSifr = function(){
		sIFR.replace( chaletNY1960, {
			selector: 'h2.chalet',
			css: [
				'.sIFR-root { color: #770000; }',
				'a { text-decoration: none; }',
				'a:link { color: #550000; }',
				'a:hover { color: #000000; }'
			],
			forceSingleLine: true,
			wmode: "transparent",
			ratios: [6, 1.24, 7, 1.21, 8, 1.18, 10, 1.16, 11, 1.13, 12, 1.12, 13, 1.11, 15, 1.1, 17, 1.09, 19, 1.08, 22, 1.07, 26, 1.06, 32, 1.05, 41, 1.04, 58, 1.03, 97, 1.02, 1.01]
		});


		sIFR.replace( chaletNY1960, {
			selector: '#content .header',
			css: [
				'.sIFR-root { float: left; color: #ffffff; float: left }',
				'a { text-decoration: none; }',
				'a:link { color: #550000; }',
				'a:hover { color: #000000; }'
			],
			fitExactly: true,
			forceWidth: true,
			preventWrap: true,
			fixWrap: true,
			tuneWidth: 120,
			display: "inline",
			wmode: "transparent",
			ratios: [6, 1.24, 7, 1.21, 8, 1.18, 10, 1.16, 11, 1.13, 12, 1.12, 13, 1.11, 15, 1.1, 17, 1.09, 19, 1.08, 22, 1.07, 26, 1.06, 32, 1.05, 41, 1.04, 58, 1.03, 97, 1.02, 1.01]
		});

		sIFR.replace( chaletNY1960, {
			selector: 'h4.chalet',
			css: [
				'.sIFR-root { color: #770000; text-align: left; font-weight: normal; }',
				'a { text-decoration: none; }',
				'a:link { color: #89000C; }',
				'a:hover { color: #000000; }'
			],
			wmode: "transparent",
			ratios: [6, 1.24, 7, 1.21, 8, 1.18, 10, 1.16, 11, 1.13, 12, 1.12, 13, 1.11, 15, 1.1, 17, 1.09, 19, 1.08, 22, 1.07, 26, 1.06, 32, 1.05, 41, 1.04, 58, 1.03, 97, 1.02, 1.01]
		});

		sIFR.replace( chaletNY1960, {
			selector: '#content p',
			css: [ '.sIFR-root { color: #ffffff; leading: 8 }' ],
			wmode: "transparent",
			fitExactly: true,
			forceWidth: true,
			antiAliasType: "advanced",
			
			tuneHeight: 2,
			sharpness: -300,
			ratios: [6, 1.24, 7, 1.21, 8, 1.18, 10, 1.16, 11, 1.13, 12, 1.12, 13, 1.11, 15, 1.1, 17, 1.09, 19, 1.08, 22, 1.07, 26, 1.06, 32, 1.05, 41, 1.04, 58, 1.03, 97, 1.02, 1.01]
		});

		sIFR.replace( chaletNY1960, {
			selector: '#content .body b.bold',
			css: [ '.sIFR-root { color: #ffffff }' ],
			wmode: "transparent",
			fitExactly: true,
			forceWidth: true,
			ratios: [6, 1.24, 7, 1.21, 8, 1.18, 10, 1.16, 11, 1.13, 12, 1.12, 13, 1.11, 15, 1.1, 17, 1.09, 19, 1.08, 22, 1.07, 26, 1.06, 32, 1.05, 41, 1.04, 58, 1.03, 97, 1.02, 1.01]
		});

		sIFR.replace( chaletLondon1960, {
			selector: '#footer p.chalet',
			css: [
				'.sIFR-root { color: #770000 }',
				'a { text-decoration: none; }',
				'a:link { color: #550000; }',
				'a:hover { color: #330000; }'
			],
			wmode: "transparent",
			fitExactly: true,
			forceWidth: true,
			ratios: [6, 1.24, 7, 1.21, 8, 1.18, 10, 1.16, 11, 1.13, 12, 1.12, 13, 1.11, 15, 1.1, 17, 1.09, 19, 1.08, 22, 1.07, 26, 1.06, 32, 1.05, 41, 1.04, 58, 1.03, 97, 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;
		emailLinks.each( function( anElement ){
			anElement.set( "text", Rot13.convert( anElement.get( "text" ) ) );
			anElement.set( "href", Rot13.convert( anElement.get( "href" ) ) );
		});
		gastronomisti.initSifr();
	});

