disableButtons = false;

function changeButtonsState(id)
{
  var radio1 = document.getElementById('radio1');
  var radio2 = document.getElementById('radio2');
  var radio3 = document.getElementById('radio3');

  switch(id){
    case 1 : radio1.checked = true;break;
    case 2 : radio2.checked = true;break;
    case 3 : radio3.checked = true;break;
    default : return;
  }
}

function wyslijDane(id)
{
  url = "http://localhost/dane.php?id=" + id;
  url = encodeURI(url);

  disableButtons = true;
  changeButtonsState(id)
  startGETRequest(url, onComplete, onEnd);
}

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

function onEnd()
{
  disableButtons = false;
}