// JavaScript Document

function login()
{ 
    var xhr; 
    try {  xhr = new ActiveXObject('Msxml2.XMLHTTP');   }
    catch (e) 
    {
        try {   xhr = new ActiveXObject('Microsoft.XMLHTTP');    }
        catch (e2) 
        {
          try {  xhr = new XMLHttpRequest();     }
          catch (e3) {  xhr = false;   }
        }
     }
 
    xhr.onreadystatechange  = function()
    {    if(xhr.readyState  == 4)
         {    if(xhr.status  == 200) {
                 alert (xhr.responseText); 
				 window.location.reload(true); 
			  } else {
                 alert ("Erreur : " + xhr.status); 
			  }
         }
    }; 
	
	user=document.form_login.user.value;
	pass=document.form_login.pass.value;
	xhr.open( "POST", "/_ajax_login.php?user="+user+"&pass="+pass, true); 
	xhr.send(null); 
} 
