var onprogress = false;

function startRequest()
{
  if(onprogress){
    alert("Trwa przetwarzanie danych.");
    return;
  }
  var taText = document.getElementById('taText').value;
  if(taText == ""){
    alert("Proszę wprowadzić tekst.");
    return;
  }

  url = "http://localhost/dane.php";
  params = "text=" + encodeURIComponent(taText);

  var onprogress = true;
  startPOSTRequest(url, params, onComplete, onEnd);
}

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

function onEnd()
{
  var onprogress = false;
}