window.onload = function()
 {
    //on associe la fonction verifId à
    //l'événénement onsubmit du formulaire
    document.getElementById('frmIdentification').onsubmit = verifId;
 }
 
 function verifId()
 {
    //envoi des données
    return !sendData(
       'GET',
       'identification-xml.php',
       'xmlhttp=1&'+
       'login='+document.getElementById('txtLogin').value+
       '&'+
       'password='+document.getElementById('txtPassword').value);
 }
 
 /**
  * Envoie des données à l'aide d'XmlHttpRequest?
  * @param string methode d'envoi ['GET'|'POST']
  * @param string url
  * @param string données à envoyer sous la forme var1=value1&var2=value2...
  */
 function sendData(method, url, data)
 {
    var xmlhttp = getHTTPObject();

    if (!xmlhttp)
    {
        return false;
    }

    if(method == "GET")
     {
     if(data == 'null')
     {
            xmlhttp.open("GET", url, true); //ouverture asynchrone
     }
     else
     {
            xmlhttp.open("GET", url+"?"+data, true);
     }
        xmlhttp.send(null);
     }
     else if(method == "POST")
     {
        xmlhttp.open("POST", url, true); //ouverture asynchrone
        xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
     xmlhttp.send(data);
     }
    return true;
 }