disableButtons = false;

function pobierzDane(co)
{
  if(disableButtons){
    alert("Trwa przetwarzanie danych.");
    return;
  }

  if(co != "data" && co != "czas"){
    return;
  }
  id = (new Date()).getTime();
  url = "http://localhost/dane.php?co=" + co;
  url += "&id=" + id;
  disableButtons = true;
  startGETRequest(url, onComplete, onEnd);
}

function onComplete(text, xml)
{
  var dataDiv = document.getElementById("dataDiv");
  dataDiv.innerHTML = text;
}

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