function startRequest()
{
  tfKodText = document.getElementById('tfKod').value;
  var btnSprawdz = document.getElementById('btnSprawdz');
  btnSprawdz.disabled = true;

  url = "http://localhost/dane.php?kod=" + tfKodText;
  url = encodeURI(url);

  startGETRequest(url, onComplete, onEnd);
}

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

function onEnd()
{
  var btnSprawdz = document.getElementById('btnSprawdz');
  btnSprawdz.disabled = false;
}