
window.addEvent('keydown', function(event){
	switch(event.code)
	{
		case 33: 
			event.stop();
			break;
		case 34: 
			event.stop();
			break;
		case 36: 
			event.stop();
			nav.changePage('top');
			break;
	}
});

var mainPath = '';
if(window.location.host == 'mguigou')
{
	mainPath = '';
}else{
	mainPath = 'fileadmin/templates/';
}

var flashed = false;
window.addEvent('domready', function()
{
	if(Browser.Plugins.Flash.version > 7)
	{
		flashed = true;
		$('container').addClass('flashed');
	}
	if($('photosAccueil'))
	{
		if(flashed && Browser.Engine.name != 'safari')
		{
			$('photosAccueil').set('html','');
			var photos = new Swiff(mainPath+"flash/diaporama.swf", { id: 'photos', width:'100%', height: 1050, params: { 'wmode': 'transparent','AllowScriptAccess':'always' }, vars: { xmlFile:"index.php?id=41" } });
			photos.inject('photosAccueil');
		}
/*		else{
			fadeImages.init({
				elements:$$('#photosAccueil li'),
				container:$('photosAccueil')
			});
*/
		//}
	}

	// 
	nav.init();
	actus.init();
	if($('newsTicker'))
	{
		window.addEvent('resize', function()
		{
			var mLeft = $$('.guig')[0].getSize().x + 10;
			var mRight = $$('.apt')[0].getSize().x + $$('.guillaume')[0].getSize().x + 10;
			var nwsTickerW = $('actusContainer').getSize().x - mLeft - mRight;
			$('newsTicker').setStyles({'margin-left':mLeft, 'margin-right':mRight, 'width':nwsTickerW, 'left':'0'});
		});
		var mLeft = $$('.guig')[0].getSize().x + 10;
		var mRight = $$('.apt')[0].getSize().x + $$('.guillaume')[0].getSize().x + 10;
		var nwsTickerW = $('actusContainer').getSize().x - mLeft - mRight;
		$('newsTicker').setStyles({'margin-left':mLeft, 'margin-right':mRight, 'width':nwsTickerW, 'left':'0'});
		fadeImages.init({
			elements:$$('#newsTicker .flash-news-item'),
			container:$('newsTicker')
		});
	}
	
	biographieHandler.init(
	{
		bio:$$('#biographie .content')[0],
		interviewsItems:$$('#biographie .content .interview'),
		interviewsLinks:$$('#biographie .content .interviewBt')
	});
	var H = new History();
	nav.changePage('top');
	encouragement.init();
	/* SUCKERFISH MENU */
	if(Browser.Plugins.Flash.version > 7)
	{
		/*FLASH
		var header = new Swiff(mainPath+"flash/head-bouscaren-nocarousel.swf", { id: 'headerAnim', width:960, height: 273, params: { wmode: 'transparent',allowScriptAccess:'always' }, vars: { mainXML:"http://auto-ecole.ecf-bouscaren.com/index.php?type=200",noDebug:'true',width:960, height:273, 'showAnim':showAnim } });
		header.inject('animC');
		*/
		//var potes = new Swiff(mainPath+"flash/potes.swf", { id: 'headerAnim', width:900, height: 900, params: { wmode: 'transparent',allowScriptAccess:'always' }, vars: { mainXML:"http://auto-ecole.ecf-bouscaren.com/index.php?type=200",noDebug:'true',width:900, height:900, 'showAnim':showAnim } });
		//potes.inject($('biographie').getChildren()[0]);
	} else {
		$('animC').setStyles(
			{
				'background':'url(fileadmin/templates/images/installflash.jpg) no-repeat 50% 50%',
				'height':'273px'
			}
		);
	}
	//Mediabox.open('htttp://www.michael-guigou.fr/typo3temp/pics/abc0a3ebdf.jpg', 'test', '');
	/*
	if(Browser.Engine.trident && Browser.Engine.version < 5)
	{
		//Suckerfish Alternative for IE, using MOOTOOLS.
		$$('#menu li').each(function(el, index)
		{
			el.addEvents(
			{
				'mouseenter':function(e)
				{
					this.addClass('over');
				},
				'mouseleave':function(e)
				{
					this.removeClass('over');
				}
			});
		});
	}
	*/

});
function testExtInt(param)
{
//	alert(param + ' - ' +param.length);
	Mediabox.open(param[0], param[1], '');
}