// ENLEVE LE FOCUS SUR LES LIENS 
window.addEvent('domready', function()
{
	$$('a').addEvent('focus', function(){if(this.blur)this.blur()});
});

// AFFICHE/CACHE UN ID
function ShowHide(id)
{
	$(id).style.display=$(id).style.display=='none'?'block':'none';
}

// ECRIT UN FLASH POUR RESOUDRE LE PBM D ACTIVATION SOUS IE
function WriteSwf(U,W,H,T)
{
	if(T==0)
	{
		T=T2="";		
	}
	else
	{
		T='<param name="wmode" value="transparent" />';
		T2=' wmode="transparent"';
	}
	document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+W+'" height="'+H+'">');
	document.writeln('<param name="allowScriptAccess" value="sameDomain" />');
	document.writeln('<param name="movie" value="'+U+'.swf" />');
	document.writeln('<param name="quality" value="high" />');
	document.writeln('<param name="menu" value="false" />'+T);
	document.writeln('<embed src="'+U+'.swf" quality="high" width="'+W+'" height="'+H+'" allowscriptaccess="sameDomain" menu="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"'+T2+' /></object>');
}

// FIX ELEMENT ( NECESSITE : body { background: url(...) FIXED; } ) 
function fixed_top(select,offS)
{
	return Number(offS+document.documentElement.scrollTop+document.body.scrollTop)+'px';
}
function fixed_bottom(select,offS)
{
	return Number(-offS+document.documentElement.clientHeight-select.offsetHeight+document.documentElement.scrollTop+document.body.scrollTop)+'px';
}

// MENU
var mySlide=[];
var Arr = new Array('menu2','menu3','menu4','menu5','menu6');
window.addEvent("domready", function() 
{
	for(var i=0; i<Arr.length; i++)
	{
		var c = Arr[i];
		$(c).style.display='block';
		mySlide[i] = new Fx.Slide(c).show();
		mySlide[i].element.setStyle('display', 'none');
		mySlide[i].mdtimer='';
		$(c+'_a').addEvent('mouseover', new Function("e","MenuIn(e,"+i+");"));
		$(c+'_a').addEvent('mouseout', new Function("e","MenuOut("+i+");"));
		$(c).addEvent('mouseover', new Function("e","MenuIn(e,"+i+");"));
		$(c).addEvent('mouseout', new Function("e","MenuOut("+i+");"));	
		MenuUp(i);
		$(Arr[i]+'_a').style.visibility='visible';
	}
});

function MenuIn(e,c)
{
	if(mySlide[c].mdtimer!=''){clearTimeout(mySlide[c].mdtimer);}
	
	mySlide[c].stop();
	mySlide[c].element.setStyle('zIndex', 10000);
	mySlide[c].element.setStyle('display', 'block');
	$(Arr[c]+'_a').className='active';
	mySlide[c].element.setStyle('display', 'block');
	e=new Event(e);
	mySlide[c].slideIn();
	e.stop();
}
function MenuUp(c)
{
	mySlide[c].stop();
	mySlide[c].element.setStyle('display', 'none');
	$(Arr[c]+'_a').className='';
	mySlide[c].element.setStyle('zIndex', 1);
	mySlide[c].slideOut();
}
function MenuOut(c)
{
	mySlide[c].mdtimer=setTimeout("MenuUp("+c+")", 100);
}
