var authentificationForm = document.forms['authentification'];

function authentifierAppel() {
	$("#errorAuthentification").hide();
	var identifiant = authentificationForm.elements['identifiant'].value;
	var password = authentificationForm.elements['password'].value;
	var session_id = authentificationForm.elements['session_id'].value;
	authentificationForm.elements['authentifier'].disabled = true;
	Post_XMLHttpRequest(1, '/global/include/authentification.php', 'session_id=' + session_id + '&identifiant=' + identifiant + '&password=' + password, authentifierRetour);
}

function authentifierRetour(xRetour) {
	var xAuth = false;
	if (xRetour != '') {
		xValues = xRetour.split('||'); 
		if(xValues[0] == '1') {
			xAuth = true;
			authentificationForm.submit();
		}
	}
	if (!xAuth) $("#errorAuthentification").show();
	authentificationForm.elements['authentifier'].disabled = false;
}
