window.addEvent('domready',function(){
	var dropdownElement = $('menu').getElement('ul');
	var DropDownMenu = new DropDown({
		'element': dropdownElement
	});
	/*if ($('ListSubMenu')) {
		var dropDownElement2 = $('ListSubMenu').getElements('ul');
		var DropDownMenu2 = new ClickDown({
			'element': dropDownElement2
		});
	}
	var oSelected = $('selectedMenu');
	if (oSelected){
		var parentMenu = $('selectedMenu').getParent();
		while (parentMenu !== null) {
			if (parentMenu.getTag() == 'li') {
				ulBase = parentMenu;
				parentMenu.setStyle("display", "list-item");
				parentMenu.setStyle("list-style-image", "url(images/public/sousmenu_less.gif)");
			}else{
				parentMenu.setStyle("display", "block");
			}
			parentMenu = parentMenu.getParent();
			if (parentMenu.id) {
				if (parentMenu.id == "conteneurSousmenu") {
					parentMenu = null;
				}
			}
		}
	}
	*/
	
});
var DropDown = new Class({
	initialize: function(options){
		
		this.setOptions(options);
		if (this.options.element.getChildren() != null) {
			var firstItems = this.options.element.getChildren();
			
			firstItems.each(function(firstItem){
			
			
				var subItem = firstItem.getElement('ul');
				if (subItem !== null) {
				
					firstItem.addEvents({
						'mouseover': function(){
							subItem.setStyle('display', 'block');
						},
						'mouseout': function(){
							subItem.setStyle('display', 'none');
						}
					});
				}
			});
		}
	}
});
DropDown.implement(new Options());
DropDown.implement(new Events());