window.addEvent('domready', function() {
	/* loading slideshow*/
	var tableau_images = ['theme/images/slideshow/slide-01.jpg','theme/images/slideshow/slide-02.jpg','theme/images/slideshow/slide-03.jpg'];
	new SimpleSlideShow($('slide'), tableau_images);
	
	/* loading flash*/
	var swfUrl = 'theme/flash/logo.swf';
	var id = 'flash';
	var width = '64';
	var height = '64';
	var version = '8.0.0';
	var expressInstallSwfurl = 'theme/flash/expressInstall.swf';
	var flashvars = {};
	var params = {wmode: "Transparent"};
	var attributes = {};
	swfobject.embedSWF(swfUrl, id, width, height, version, expressInstallSwfurl, flashvars, params, attributes);	
	
	/* loading dynamic anchor menu*/
	var anchormenu = new Element('ul',{'class':'sous-menu'});
	$$('.anchor').each(function(anchor){
		myLi = new Element('li');
		var anchorlink = new Element('a',{
			//'href': document.location.href +'#'+anchor.getProperty('id'),
			'href': document.location.href +'#'+anchor.getProperty('id'),
			'html':anchor.get('html')/*,
			'events': {
				'click': function(e){
					new Fx.Scroll('scroller', {duration: 800,wait: true}).toElement(anchor.getProperty('id'));
					//e.stop();
				}
			}*/
		}
		);
		anchorlink.inject(myLi);
		myLi.inject(anchormenu);
	});
	anchormenu.inject($$('div.menu')[0],'before');

	/* 
		Valid target='_blank'
		use: <element class='_blank'></element>
	*/
	$$('._blank', '.outlink a').each(function(lien){
		lien.addEvent('click', function(){
			window.open(this.href)
			return false;
		});
	});
	
	var popins = $$('.popin');
	
	if(popins.length > 0 ){
		var box = new multiBox('popin', {
			overlay: new overlay(),
			showControls: false
		});

	}
});