function startRequest()
{
  var tfIp = document.getElementById('tfIp');
  tfIpText = tfIp.value;
  tfIp.disabled = true;

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

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

  tfIp.disabled = false;
  btnSprawdz.disabled = false;
}

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