//at page load
Event.observe(window,'load', function () {
	$A($('menu_g').getElementsByTagName('a')).each(function (a_cour) {
		if (!Element.hasClassName(a_cour.parentNode, 'actif'))
			Event.observe(a_cour, 'mouseover', set_a_over_event);
	});
});

function set_a_over_event(ev_cour) {
	a_faire = setTimeout(function () {
		li_prec = $('menu_g').getElementsByClassName('actif')[0];
		Effect.Fade($('travail')); // , {queue: 'front'}
		Element.removeClassName(li_prec, 'actif');
		Event.observe(li_prec.firstChild, 'mouseover', set_a_over_event)
		Element.addClassName(this.parentNode, 'actif');
		setTimeout(function () {
			//here is the ajax request
			new Ajax.Updater('travail', 'ajax/' + this.href.replace(/^.*\//, ''), {evalScripts: true, onComplete: function () {
				Effect.Appear($('travail'), {queue: 'end'});
				Event.stopObserving(this, 'mouseover', set_a_over_event);
				masquer();
			}.bind(this)} );
		}.bind(this), 1000);
	}.bind(Event.element(ev_cour)), 1000);
	Event.observe(Event.element(ev_cour), 'mouseout', function (event) {
		clearTimeout(a_faire);
		});
}