function startRequest()
{
  var tfHost = document.getElementById('tfHost');
  tfHostText = tfHost.value;
  tfHost.disabled = true;

  var btnSprawdz = document.getElementById('btnSprawdz');
  btnSprawdz.disabled = true;
  
  url = "http://localhost/dane.php?host=" + tfHostText;
  url = encodeURI(url);
  startGETRequest(url, onComplete, onEnd);
}

function onEnd()
{
  var tfHost = document.getElementById('tfHost');
  var btnSprawdz = document.getElementById('btnSprawdz');

  tfHost.disabled = false;
  btnSprawdz.disabled = false;
}

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