
/*******************************************************************************************************/ 
/*  En cours d'optimisation ECHO ***********************************************************************/
/*******************************************************************************************************/ 


window.addEvent('domready', function() {
	
	//create our Accordion instance
	var myAccordion = new Accordion($('accordion'), 'h3.toggler', 'h3.toggleractu', 'div.element', {
		opacity: true,
		onActive: function(toggler, element){
			toggler.setStyle('background-color','#C72600');
			$('actu').setStyle('background-color', '#EFEFEF');
		},
		onBackground: function(toggler,element){
			toggler.setStyle('background-color','#222');
			$('actu').setStyle('background-color','#EFEFEF');

		}
	});
	
	
 
/*******************************************************************************************************/ 
/*  vignette   *****************************************************************************************/
/*******************************************************************************************************/ 

var tipsref = new Tips($$('.clients'), {
		className: 'custom',
		offsets:({'x': 0, 'y': -128}),
		initialize:function(){
		this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 150, wait: false}).set(0);
		
		},
		onShow: function(toolTip) {
		this.fx.start(1);
		},
		onHide: function(toolTip) {
		this.fx.start(0);
		}
});
var tipsref = new Tips($$('.clientsOff'), {
		className: 'custom',
		offsets:({'x': 0, 'y': -128}),
		initialize:function(){
		this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 150, wait: false}).set(0);
		
		},
		onShow: function(toolTip) {
		this.fx.start(1);
		},
		onHide: function(toolTip) {
		this.fx.start(0);
		}
});
var tipslink = new Tips($$('.friend'), {
		className: 'friend',
		offsets:({'x': 0, 'y': -40}),
		initialize:function(){
		this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 150, wait: false}).set(0);
		},
		onShow: function(toolTip) {
		this.fx.start(1);
		},
		onHide: function(toolTip) {
		this.fx.start(0);
		}
});


/*******************************************************************************************************/ 
/* Morph nav li et span ********************************************************************************/ 
/*******************************************************************************************************/ 
$$('#djobList li').each(function(el) { 
		
		el.addEvent('mouseenter',function(){
		el.setStyle('background','url(img/icone_repertoire.gif) no-repeat 0 1px');
		})
		
		el.addEvent('mouseleave',function(){
		el.setStyle('background','url(img/icone_repertoire2.gif) no-repeat 0 1px' );
		})
	
})



/*******************************************************************************************************/ 
/* Morph nav li et span *******************************************************************************/ 
/*******************************************************************************************************/ 

$$('#djobList_archive li').each(function(el) { 
		
		el.addEvent('mouseenter',function(){
		el.setStyle('background','url(img/icone_popup2.gif) no-repeat 0 1px');
		})
		
		el.addEvent('mouseleave',function(){
		el.setStyle('background','url(img/icone_popup.gif) no-repeat 0 1px' );
		})
	
})

/********************************************************************************************************/ 
/* Link effect A ****************************************************************************************/ 
/*******************************************************************************************************/ 

	var brille = $$('body a');
	brille.each(function(element) {
	var fx = new Fx.Styles(element, {duration:250, wait:false});
 	element.addEvent('mouseenter', function(){
		fx.start({
			'color' :'#C72600'
		});
	});
	element.addEvent('mouseleave', function(){
		fx.start({
			'color' :'#212020'
		});
	});
});
	
/********************************************************************************************************/ 	
/**Footer Link effect A *********************************************************************************/ 
/*******************************************************************************************************/ 


var brille2 = $$('a#herbergeur','a#email','a#echo','a#backhome','a#newsletter','a#openallworks','h3#portfolio','h3#info');
	brille2.each(function(element) {
	var fx1 = new Fx.Styles(element, {duration:500, wait:false});
 	element.addEvent('mouseenter', function(){
		fx1.start({
			'background-color':'#C72600'
		});
	});
	element.addEvent('mouseleave', function(){
		fx1.start({
			'background-color':'#1B1B1B' /*1B1B1B*/
		});
	});
});
	

/********************************************************************************************************/ 	
/****** Form newsletter *********************************************************************************/ 	
/********************************************************************************************************/ 	

var form = $('newsinscription');
var fx = form.effects({duration: 800, transition: Fx.Transitions.Quart.easeOut});
var fx2 = form.effects({duration: 800, transition: Fx.Transitions.Quart.easeOut});
//var fx3 = [];

$('newsletter').addEvent('click', function() {
	fx.start({
		'opacity': 1,
		'margin-left':	-232
		//'margin-top':	0
	})
});

	$('close').addEvent('click', function() {
	fx2.start({
		'opacity': .0,
		'margin-left':	-900
	})
});
 

/*-----------------------------------------------------------------------------------------------*/

});

	