var xhr = null; 

function SetWorkSafe(mode)
{


getXhr();

xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {
     alert("Modification done");
     window.location.reload();
     }
    }

update("/profil/SetWorkSafe.php?mode=" + mode);


//fin liste geofencing
}



function getXhr()
{
     if(window.XMLHttpRequest)xhr = new XMLHttpRequest(); 

else if(window.ActiveXObject)
  { 
  try{
     xhr = new ActiveXObject("Msxml2.XMLHTTP");
     } catch (e) 
     {
     xhr = new ActiveXObject("Microsoft.XMLHTTP");
     }
  }
else 
  {
  alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
  xhr = false; 
  } 
}


function update(fichier)
{
xhr.open("GET", fichier, false);
xhr.send(null);
}


function updatetrue(fichier)
{
xhr.open("GET", fichier, true);
xhr.send(null);
}








