var interval = 10;
var onprogress = false;

function startRequest()
{
  if(!onprogress){
    id = (new Date()).getTime();
    url = "http://localhost/dane.php?id=" + id;
    onprogress = true;
    startGETRequest(url, onComplete, onEnd);
  }
  setTimeout("startRequest()", interval * 1000);
}

function onComplete(text, xml)
{
  if(text != "error"){
    var div = document.getElementById('mainDiv');
    div.style.backgroundImage = "url('" + text + "')";
  }
}

function onEnd(text, xml)
{
  onprogress = false;
}
