/* Nécessite le framework Prototype (version 1.5.1), lib_core.js, lib_dhtml_core.js et lib_dhtml_pr.js */

var Didacticiel = {};
Didacticiel.prototype = new ConfigurableObject();
Didacticiel.zoneCollection = null;
Didacticiel.currentEntry = null;

Didacticiel.activate = function()
{
	var cElem = Event.element(arguments[0]);
	
	if(Object.isInitialized(cElem))
	{
		Didacticiel.zoneCollection.each(function(elem)
		{
			var cont = elem.nextSiblings();
			
			if(elem == cElem)
			{
				Element.addClassName(elem,Didacticiel.prototype.getConfigProperty('activeClass'));
				cont[0].style.display = 'block';
			}
			else
			{
				Element.removeClassName(elem,Didacticiel.prototype.getConfigProperty('activeClass'));
				cont[0].style.display = 'none';
			}
		});
		
	}
}

Didacticiel.init = function()
{
	Didacticiel.prototype.initConfig({rootElement: {tagName: 'ul',className: 'menu'},descendentElement: {tagName: 'li'},activeClass: 'actif'});
	
	if(window.menuConfig)
	{
		Didacticiel.prototype.setConfig(menuConfig);
	}
	
	Didacticiel.zoneCollection = $('liste-sommaire').getElementsBySelector('li > h3');
	
	Didacticiel.zoneCollection.each(function(elem)
	{
		Event.observe(elem,'click',Didacticiel.activate);
	});
}

if(window.Prototype)
{
	Event.observe(window,'load',Didacticiel.init);
}
