// ------------------------------------------------------------------------------------------
// Initialisation d'ajax
// ------------------------------------------------------------------------------------------

var http_request = false;
var timerID = 5;

// ------------------------------------------------------------------------------------------
// Chargement d'une image
// ------------------------------------------------------------------------------------------

function ajaxLoadWebCam(path) 
  {
   var date = new Date();
   var timestamp = date.getTime();
   /* var url = 'ajax.php?' + 'time='+ timestamp; */
   var url = '/iphone/ajax.php';
  
    try 
      { 
        xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");}  catch (e) { alert("Error: Could not load page.");}

/*          document.getElementById("image").innerHTML = 'Loading Page...'; */

         xmlhttp.onreadystatechange = function()
           {
             if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) 
               { 
                 document.getElementById("image").innerHTML = xmlhttp.responseText; 
                 document.getElementById("image").style.opacity=99;
                 document.getElementById("image").style.opacity=100;
                 timer();


               }
           }
         xmlhttp.open("GET", url,true);
         xmlhttp.send(null);
         return false;
  } 


function timer()
  {
    timerID = window.setInterval("ajaxLoadWebCam()",30000);
  }