document.observe("dom:loaded", function()
{	
	/* masque element */
	$$('.hideOnLoad').each(function(s)
	{               
		s.hide();                           
		s.removeClassName('hideOnLoad');
	});
	

	$$('.showHide').each(function(s)
	{ 
		s.observe("click",function(evt){
				//Effect.toggle(s.up().next('.more'), 'blind', { duration: 0.2 });
				s.up().next('.more').toggle();
				s.toggleClassName('open');
				evt.stop();
		});			
	
	});	
	
	
	/* retour en haut de page */
	$$('.topLnk').each(function(p) {
		p.down().observe("click",function(evt){
			new Effect.ScrollTo('top',{duration:0.5});
			Event.stop(evt);
		});
	});	
	
	
});


/*  =================================================================
/*  =Formulaire - Highlight du champ selectionne
/*  ================================================================*/

document.observe('dom:loaded',function()
{
	$$('.form').each(function(o)
	{
		new highLightForm(o);
	});
});

var highLightForm = Class.create(
{
	initialize:function(elt)
	{
		this.elt = $(elt);
		this.fields = this.elt.select('input', 'select', 'textarea');
		this.fields.invoke('observe','focus',this.highLight.bindAsEventListener(this));
		this.fields.invoke('observe','blur',this.noLight.bindAsEventListener(this));
	},
	highLight:function(evt)
	{
		field = Event.element(evt);	
		field.addClassName('selected');
	},
	noLight:function(evt)
	{
		field = Event.element(evt);	
		field.removeClassName('selected');
	}
});