function getXmlHttpObject() {
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}


function doAjax(loading,done,param,url) {
   xmlHttp = getXmlHttpObject();  
   if (xmlHttp==null) {
        alert ("Your browser does not support AJAX!");
        return;
     }    
   xmlHttp.onreadystatechange=function() {
       if (xmlHttp.readyState==4) done(xmlHttp,param); else 
          if (loading != null) loading(xmlHttp.readyState,param);        
   }   
   xmlHttp.open("GET",url,true);
  /* if (xmlHttp.overrideMimeType) {   // nefunguje v IE :-( 
            xmlHttp.overrideMimeType('text/xml; charset=windows-1250');
     }*/    
   xmlHttp.send(null);    
}




function loadingPage(state,param) {
  if (state == 1) document.getElementById(param).innerHTML = "<span id=\"loading\"> Loading... </span>" ;
}


function loadPage(xmlHttp,param) {  
  funct = function() { document.getElementById(param).innerHTML = xmlHttp.responseText; } 
  setTimeout(funct,500);     
}




