function openLogin(){
	if(document.getElementById('blocLogin').style.display == 'block') 
		document.getElementById('blocLogin').style.display = 'none'; 
	else document.getElementById('blocLogin').style.display = 'block'
}
function showForget(){
	if(document.getElementById('forget').style.display == 'block') 
		document.getElementById('forget').style.display = 'none'; 
	else document.getElementById('forget').style.display = 'block'
}
function connect(l){
	var username=document.getElementById("username").value;
	var password=document.getElementById("password").value;
	$.ajax({
			type: 'POST',
			data: 'l='+l+'&username='+username+'&password='+password+'&output=monCompte',
			url: '/command.php/client/connect',
			cache: false,
			success: function(html){
				if(html.substring(0,3) == "NC_"){
					$('#messageLogin').html(html.substring(3));
				}
				else {
					$('#blocMonCompte').html(html);
					openLogin();
				}
			}
		});
}
function disConnect(){
		$.ajax({
			type: 'GET',
			url: '/command.php/client/disconnect?l=fr',
			cache: false,
			success: function(html){
				$('#blocMonCompte').html(html);
			}
		});
}
function sendPassword(langue){
	var email=document.getElementById("email").value;
	$.ajax({
			type: 'POST',
			data: 'email='+email+'&l='+langue,
			url: '/command.php/client/sendPassword',
			cache: false,
			success: function(html){
				$('#notification').html(html);
				showForget();
				openLogin();
				notification(html);
			}
		});
	
}

