var MooTip = {
	start: function(){
		var customTips = $$('#navi li.lion a');

		customTips.each(function(e) {  
			var content = e.getParent();
			content = content.getChildren('span');
			e.store('tip:text', content[0]);  
		});  

		var toolTips = new Tips(customTips, {
									className: 'mooTip', 
									fixed: 'true', 
									showDelay: 500, hideDelay: 500,
									offsets: { x: 200, y: -100 },

									onShow: function(toolTipElement){
											toolTipElement.fade(1);
									},

									onHide: function(toolTipElement){
											toolTipElement.fade(0);
									}
		});
	}
};

var SiteFLIR = {
	start: function(){
		FLIR.init( { path: webroot + '/js/common/libraries/facelift/' } );

		FLIR.replace( 'h3', new FLIRStyle({ cFont:'cocon_bold_condensed', mode:'fancyfonts', ff_Wrap:true }) );

		$$('div#content h4').each(function(el){
			if(el.hasClass('nowrap')){
				FLIR.replace(el, new FLIRStyle({ cFont:'cocon_regular', mode:'fancyfonts', ff_Wrap:false }) );
			} else {
				FLIR.replace(el, new FLIRStyle({ cFont:'cocon_regular', mode:'fancyfonts', ff_Wrap:true }) );
			}
		});

		FLIR.replace( '*.flir-standard', new FLIRStyle({ cFont:'cocon_regular', mode:'fancyfonts', ff_Wrap:true }) );
		FLIR.replace( '*.flir-slim', new FLIRStyle({ cFont:'cocon_light', mode:'fancyfonts', ff_Wrap:true }) );
		FLIR.replace( '*.quote', new FLIRStyle({ cFont:'cocon_regular', mode:'fancyfonts', ff_Wrap:true }) );
	}
}

var Site = {
	start: function(){
		SiteFLIR.start();
		if(typeof(Tips) !== 'undefined'){ MooTip.start(); }
	}
}

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