var xmlHttp = createXmlHttpRequestObject();  

function saveDragDropNodes(idclanku,znamka,typ)
{
		var a1 = "";
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
    {
    a1 = "/zapocitat/" + idclanku + "/" + znamka + "/" + typ + "/zapocitani.html";     
     xmlHttp.open("GET", a1 , true);  
      xmlHttp.onreadystatechange = handleServerResponse;
     xmlHttp.send(null);
    }
    else
     setTimeout('process()', 1000);
	}
	

function createXmlHttpRequestObject() 
{	
  var xmlHttp;
  if(window.ActiveXObject)
  {
    try
    {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  else
  {
    try 
    {
      xmlHttp = new XMLHttpRequest();
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  if (!xmlHttp)
 
    alert("Error creating the XMLHttpRequest object.");
  else 
    return xmlHttp;
}


function handleServerResponse() 
{

document.getElementById("divMessage").innerHTML = '<b>Děkujeme za hodnocení</b>';
/*
  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      // extract the XML retrieved from the server
      xmlResponse = xmlHttp.responseXML;
      // obtain the document element (the root element) of the XML structure
      xmlDocumentElement = xmlResponse.documentElement;
      // get the text message, which is in the first child of
      // the the document element
      helloMessage = xmlDocumentElement.firstChild.data;
      // update the client display using the data received from the server
      document.getElementById("divMessage").innerHTML = 
                                            '<i>jfdgkskjgfsg</i>';
      // restart sequence
      setTimeout('process()', 1000);
    } 
    else 
    {
      alert("There was a problem accessing the server: " + xmlHttp.statusText);
    }
  }*/
}



