// JavaScript Document

window.addEvent('domready', function(){
	var info_alpha = new Fx.Style('info', 'opacity', {duration: 300} );
	var info_slide = new Fx.Slide('info', {duration: 300});
	
	info_slide.hide();
	$('infoDisplay').style.display = 'block';

	$('InfoTitre').addEvent('mouseenter', function(e){
		e = new Event(e);
		info_alpha.stop();
		info_slide.stop();
		
		info_slide.slideIn();
		info_alpha.start(1)
		e.stop();
	});
	 
	$('InfoTitre').addEvent('mouseleave', function(e){
		e = new Event(e);
		info_alpha.stop();
		info_slide.stop();
		
		info_slide.slideOut();
		info_alpha.start(0);
		e.stop();
	});

	
	
	var offres_alpha = new Fx.Style('offres', 'opacity', {duration: 300} );
	var offres_slide = new Fx.Slide('offres', {duration: 300});
	
	offres_slide.hide();
	$('offresDisplay').style.display = 'block';
	
	$('OffresTitre').addEvent('mouseenter', function(e){
		e = new Event(e);
		offres_alpha.stop();
		offres_slide.stop();
		
		offres_slide.slideIn();
		offres_alpha.start(1);
		e.stop();
	});
	 
	$('OffresTitre').addEvent('mouseleave', function(e){
		e = new Event(e);
		offres_alpha.stop();
		offres_slide.stop();
		
		offres_slide.slideOut();
		offres_alpha.start(0);
		e.stop();
	});
	

	var aides_alpha = new Fx.Style('aides', 'opacity', {duration: 300} );
	var aides_slide = new Fx.Slide('aides', {duration: 300});
	
	aides_slide.hide();
	$('aidesDisplay').style.display = 'block';
	
	$('AidesTitre').addEvent('mouseenter', function(e){
		e = new Event(e);
		aides_alpha.stop();
		aides_slide.stop();
		
		aides_slide.slideIn();
		aides_alpha.start(1);
		e.stop();
	});
	 
	$('AidesTitre').addEvent('mouseleave', function(e){
		e = new Event(e);
		aides_alpha.stop();
		aides_slide.stop();
		
		aides_slide.slideOut();
		aides_alpha.start(0);
		e.stop();
	});
	
	
	var engagement_alpha = new Fx.Style('engagement', 'opacity', {duration: 300} );
	var engagement_slide = new Fx.Slide('engagement', {duration: 300});
	
	engagement_slide.hide();
	$('engagementDisplay').style.display = 'block';
	
	$('EngagementTitre').addEvent('mouseenter', function(e){
		e = new Event(e);
		engagement_alpha.stop();
		engagement_slide.stop();
		
		engagement_slide.slideIn();
		engagement_alpha.start(1);
		e.stop();
	});
	 
	$('EngagementTitre').addEvent('mouseleave', function(e){
		e = new Event(e);
		engagement_alpha.stop();
		engagement_slide.stop();
		
		engagement_slide.slideOut();
		engagement_alpha.start(0);
		e.stop();
	});
	

});

MM_preloadImages('images/but_engagements_roll.gif','images/but_colocations_roll.gif','images/but_locations_roll.gif','images/but_aides_roll.gif','images/but_infos_roll.gif','images/but_home_roll.gif');
	/**********************/

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}