function MM(rodic){ 
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
    xmlHttp.open("GET", "/lib/ajax.menu.php?rodic=" + rodic, true);
    xmlHttp.onreadystatechange = handleServerResponse;
    xmlHttp.send(null);
    return false; // hodnota false ma zde opacny vyznam ;-)
  }
  else
    setTimeout('MM('+rodic+')', 1000);
}

var removeID='';
function handleServerResponse(){
  if (xmlHttp.readyState == 4) 
  {
    if(xmlHttp.status == 200)
    {
      xmlResponse = xmlHttp.responseXML;
      xmlDoc = xmlResponse.documentElement;
      var html=xmlDoc.getElementsByTagName('response')[0].childNodes[0].nodeValue;
      var menu=xmlDoc.getElementsByTagName('id')[0].childNodes[0].nodeValue;

      if(removeID>0 && topMenu.inArray(menu)){
        //document.getElementById('rodic'+removeID).innerHTML='';
         document.getElementById('showlist').innerHTML=topMenu2;
         //setTimeout('document.getElementById(\'showlist\').innerHTML=topMenu2;',10);
      }
      if(topMenu.inArray(menu)) removeID=menu;
      document.getElementById('menuID'+menu).innerHTML=html;
    }
    else 
    {
      //alert("There was a problem accessing the server: " + xmlHttp.statusText);
    }
  }
}
