var SiteFLIR = {
	start: function(){
		FLIR.init( { path: '/js/facelift/' } );
		FLIR.replace( 'h4', new FLIRStyle({ cFont:'museo_sans_500' }) );
		FLIR.replace( 'div.aboutbox h2', new FLIRStyle({ cFont:'museo_sans_500' }) );
		FLIR.replace( 'div#login h2', new FLIRStyle({ cFont:'museo_sans_500' }) );
		FLIR.replace( 'span.tagline', new FLIRStyle({ cFont:'museo_sans_500', mode:'wrap' }) );
		FLIR.replace( 'span.attributation', new FLIRStyle({ cFont:'museo_sans_500' }) );

		FLIR.replace( 'ul#switcher span', new FLIRStyle({ cFont:'museo_sans_500', cSize:'*1.45' }) );
	}
};

var Flash = {
	start: function(){
		var e = $('flashMessage');

		if(e){
			
			var myEffect = new Fx.Morph(e, {duration: 500, transition: Fx.Transitions.Sine.easeOut});
 			myEffect.start.pass(({ 'background-color': '#fffc1e' }), myEffect).delay(1200);

			var myEffect = new Fx.Morph(e, {duration: 3000, transition: Fx.Transitions.Sine.easeOut});
 			myEffect.start.pass(({ 'background-color': '#fffe94' }), myEffect).delay(2000);

			var myEffect = new Fx.Morph(e, {duration: 5000, transition: Fx.Transitions.Sine.easeOut});
 			myEffect.start.pass(({ 'opacity': '0' }), myEffect).delay(20000);

			e.setStyle.pass((['display', 'none']), e).delay(24000);
		}
	}
};


var Site = {
	start: function(){
		SiteFLIR.start();
		Flash.start();

		if(typeof(Switcher) !== 'undefined') { Switcher.start(); }
		if(typeof(GMaps) !== 'undefined') { GMaps.start(); }
	}
};

window.addEvent('domready', Site.start);
