/**
* Method called to update random photo
*/
function update_random_photo(){
   var xhr = getXhr();
   //Define behaviour
   xhr.onreadystatechange = function(){
      // On ne fait quelque chose que si on a tout reçu et que le serveur est ok
      if(xhr.readyState == 4 && xhr.status == 200){
         di = document.getElementById('diaporama');
         di.innerHTML = xhr.responseText;
      }
   }
   
   //Define POST method and header
   xhr.open("POST","php/inc.random-photo.php",true);
   xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');

   //POST parameters
   xhr.send();			
   
   //Set Timeout
   setTimeout("update_random_photo()",5000);
}
      
