window.addEvent('domready', function(){
	if($('no-js')){
		$('no-js').setStyle('display','none');
		$('no-js').destroy();
		$('top').setStyle('display','block');
	}
	
	Swiff.ExpressInstall = new Class({
		 Extends: Swiff,
			 options: {
			   expressInstall: '/swf/expressInstall.swf'
		   },
			 initialize: function(path, version, build, options){
			   if(Browser.Plugins.Flash.version >= version && Browser.Plugins.Flash.build >= build) this.parent(path, options);
			   else this.parent(this.options.expressInstall, $extend({vars: {
				   MMPlayerType: (Browser.Engine.trident) ? 'ActiveX' : 'PlugIn',
				   MMredirectURL: window.location,
				   MMdoctitle: document.title.slice(0, 47) + ' - Flash Player Installation'
			   }}, options));
		   }
	});
	
	if($('header')){
		$('header').addEvent('click', function(){
			window.location = $('header').getElement('h1').getChildren('a')[0].href;
		})
	}
	
	if($('accueil-part')){
		var accueil = new Swiff.ExpressInstall('/swf/accueil-part.swf', 8, 0, {
			id: 'accueil-part',
			width: 546,
			height: 430,
			container: $('accueil-part'),
			params: {
				wmode: 'transparent'
			}
		});
	}
	
	if($('accueil-pro')){
		var accueil = new Swiff.ExpressInstall('/swf/accueil-pro.swf', 8, 0, {
			id: 'accueil-pro',
			width: 546,
			height: 400,
			container: $('accueil-pro'),
			params: {
				wmode: 'transparent'
			}
		});
	}
	
	if($('footer-part')){
		var accueil = new Swiff.ExpressInstall('/swf/footer_part.swf', 8, 0, {
			id: 'footer-part-flash',
			width: 962,
			height: 120,
			container: $('footer-part'),
			params: {
				wmode: 'transparent'
			}
		});
	}
	
	if($('footer-pro')){
		var accueil = new Swiff.ExpressInstall('/swf/footer_pro.swf', 8, 0, {
			id: 'footer-pro-flash',
			width: 962,
			height: 120,
			container: $('footer-pro'),
			params: {
				wmode: 'transparent'
			}
		});
	}
	
	/*if($('header')){
		var header = $('header');
		header.addEvent('click', function(){window.location=header.getChildren('a')[0].href})
	}*/
	
	// Menus hovering
	$$('div.red-hover ul li').each(function(element){
		var ela = element.getChildren('p')[0].getChildren('a')[0];
		element.addEvent('click', function(){document.location=ela.href});
		
		new Element('p', {'class':'red'}).inject(element, 'top');
		new Element('p', {'class':'black'}).inject(element, 'top');
		
		var elp = element.getChildren('p')[1];
		elp.set('tween', {'duration':200});
		
		element.addEvent('mouseover', function(){elp.tween('width', 190)});
		element.addEvent('mouseout', function(){elp.tween('width', 0)});
		
		// Clip method
		/*
		var elp = element.getChildren('p')[1]
		elp.set('tween', {duration:'short'})
		
		element.addEvent('mouseover', function(){elp.tween('clip', '0px 180px 20px 180px')})
		element.addEvent('mouseout', function(){elp.tween('clip', '0px 180px 20px 0px')})
		*/
	});
	
	// HR
	$$('hr').each(
		function(element) {
			var div = new Element('div', {'class':'hr'});
			div.wraps(element);
		}
	)
	
	// Habitat hovering
	$$('div.slide-hover ul li').each(function(element){		
		var bgSlide = new Fx.Tween(element, {'duration':190});
		
		element.addEvent('mouseenter', function(){
			bgSlide.start('background-position', '0px -20px').
				chain(function(){element.setStyle('background-position', '0px 0px')})
			})
	})
	
	/* H4 */
	$$('h4').each(function(h4){
		h4.addClass('typeface-js');			   
	});
	
	/* IMG YMS */
	$$('img').each(function(img){
		if (img.getProperty('align') == "left") {
			img.setStyle('margin-left', '15px');
			img.setStyle('margin-right', '15px');
		}
		else if (img.getProperty('align') == "right") {
			img.setStyle('margin-left', '15px');
			img.setStyle('margin-right', '15px');
		}
	});
	
	/* TABLEAUX */
	$$('table').each(function(table){
		if(table.getProperty('border') == 1) {
			table.addClass('border');
		}
		table.removeProperty('border');
	});
	
})