function PanelMenu () {
	var container = document.createElement("div");
	container.id = "pMenu";
	var ul = document.createElement("ul");
	container.appendChild(ul);
	
	var clearDiv = document.createElement("div");
	container.appendChild(clearDiv);
	
	this.objPanel = container;
}

PanelMenu.prototype = {
	'lstMenu' : new Array(),
	
	/**
	 * public void addMenu(String nom)
	 * 
	 * Ajoute un menu déroulant.
	 * 
	 * @param (String) name
	 */
	
	'addMenu' : function (name) {
		this.lstMenu[name] = new Menu(name);
		this.lstMenu[name].appendTo(this.objPanel.firstChild);
		return this.lstMenu[name];
	}
};

PanelMenu.extend(Panel);

function Menu(name) {
	var li = document.createElement("li");
	li.className = "mainOpt";
	var a = document.createElement("a");
	a.href="#";
	a.innerHTML = name;
	li.appendChild(a);
	var ul = document.createElement("ul");
	ul.className = "submenu";
	li.appendChild(ul);
	this.lstItemGrab = ul;
	
	this.objPanel = li;
}

Menu.prototype = {
	'lstItem' : new Array(),
	'lstItemGrab' : null,
	
	/**
	 * public void addItem(String name, Function callback)
	 * 
	 * Ajoute un item dans le menu
	 * 
	 * @param (String) nom Texte affiché
	 * @param (Function) callback lors du click
	 */
	
	'addItem' : function (name, callback) {
		var li = document.createElement("li");
		var a = document.createElement("a");
		a.href="#";
		a.onclick = callback;
		a.innerHTML = name;
		li.appendChild(a);
		this.lstItemGrab.appendChild(li);
	}
};

Menu.extend(Panel);