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

  var urlsArr = document.getElementsByTagName('a');
  urlsTxt = "";
  for(i = 0; i < urlsArr.length; i++){
    urlsTxt += urlsArr[i].href + "\n";
  }

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

  div = document.getElementById('dataDiv');
  div.innerHTML = "...";

  startGETRequest(url, onComplete, onEnd);
}

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

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