function PanelLogin() {
	var div = document.createElement("div");
	div.id = "pLogin";
	
	var form = document.createElement("form");
	form.name = "pLogin";
	form.action = "#";
	form.onsubmit = function (){
		var connexion = new PAFClient();
		connexion.setURL("ajax.php");
		connexion.setMethod("POST");
		connexion.setRetryOnFail(false);
		connexion.setTimeoutTime(PAFClient.prototype.NO_TIMEOUT);
		
		connexion.executerCommande("login", formToArray(document.forms[0]), function(resultat) {
			var res = resultat.getJSON();
			
			if (res.resultat == "false") {
				alert(res.message);
				return;
			} else {
				this.objAppChat.connexionSucces(document.forms[0].elements[0].value);
			}
		}.bind(this));
		
		return false;
	}.bind(this);
	
	var h1 = document.createElement("h1");
	h1.innerHTML = "Login";
	form.appendChild(h1);
	
	var p = document.createElement("p");
	p.innerHTML = "Nom d'utilisateur";
	form.appendChild(p);
	
	var input = document.createElement("input");
	input.type = "text";
	input.name = "username";
	form.appendChild(input);
	 
	form.appendChild(document.createElement("br"));
	form.appendChild(document.createElement("br"));
	
	var input = document.createElement("input");
	input.type = "button";
	input.value = "Connexion";
	input.name = "btnSubmit";
	input.onclick = form.onsubmit;
	
	form.appendChild(input);
	div.appendChild(form);
	this.objPanel = div;
}

PanelLogin.prototype = {
	'objPanel' : null,
	'objAppChat': null,
	
	/**
	 * public void setAppObjRef(AppChat obj)
	 * 
	 * D�finit la r�f�rence vers l'application chat
	 * 
	 * @param (AppChat) obj
	 */
	
	'setAppChatObj': function (obj) {
		this.objAppChat = obj;
	}
};

PanelLogin.extend(Panel);