// JavaScript Document

function setNoteJeu(id_jeu, note)
{ 
    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;   }
        }
     }
    var xhr2; 
    try {  xhr2 = new ActiveXObject('Msxml2.XMLHTTP');   }
    catch (e) 
    {   try {   xhr2 = new ActiveXObject('Microsoft.XMLHTTP');    }
        catch (e2) 
        { try {  xhr2 = new XMLHttpRequest();     }
          catch (e3) {  xhr2 = false;   }
        }
     }	 	 
 
    xhr.onreadystatechange  = function()
    {    if(xhr.readyState  == 4)
         {    if(xhr.status  == 200) {
				 if (xhr.responseText == "") {
					 xhr2.open( "POST", "/_ajax_refresh_note_jeu_a_vote.php?id=" + id_jeu, true); 
					 xhr2.send(null); 
				 } else {
	                 alert (xhr.responseText); 
				 }			 
			  } else {
                 document.getElementById("Note_jeu").value = "Erreur : " + xhr.status; 
			  }
         }
    }; 
    xhr2.onreadystatechange  = function()
    {    if(xhr2.readyState  == 4)
         {    if(xhr2.status  == 200) {
                 document.getElementById("Note_jeu").innerHTML = xhr2.responseText;
			  } else {
                 alert ("Erreur : " + xhr2.status); 
			  }
         }
    }; 

   xhr.open( "POST", "/_ajax_set_note_jeu.php?id=" + id_jeu + "&note=" + note,  true); 
   xhr.send(null); 
} 
