disableButtons = false;

function loadArticle(id)
{
  if(disableButtons) return;
  if(id < 1 || id > 3) return;
  url = "http://localhost/dane.php?id=" + id;
  disableButtons = true;
  startGETRequest(url, onComplete, onEnd);
}

function onComplete(text, xml)
{
  if(text == "error"){
    alert("Dane nie są dostępne.");
  }
  else{
    var dataDiv = document.getElementById('dataDiv');
    dataDiv.innerHTML += text;
  }
}

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