   // Ajax //
   ajax = new Object();

      ajax.initialize = function(){

         ajax.xml_http = null;

         try {
            ajax.xml_http = new XMLHttpRequest ();
         }
         catch (e){
            try {
               ajax.xml_http = new ActiveXObject ('Msxml2.XMLHTTP')
            }
            catch (e){
               ajax.xml_http = new ActiveXObject ('Microsoft.XMLHTTP');
            }
         }

      }

      ajax.post = function (url, params, onreadystatechange, sync, id){

         if (typeof sync == 'undefined') sync = true;

         ajax.initialize();
         ajax.xml_http.open ('POST', url, sync);
         ajax.xml_http.onreadystatechange = function(){ if (onreadystatechange != null && (ajax.xml_http.readyState == 4 || ajax.xml_http.readyState == 200)) onreadystatechange(id).call(); }
         ajax.xml_http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
         ajax.xml_http.setRequestHeader('Content-Length', params.length);
         ajax.xml_http.setRequestHeader('Connection', 'close');
         ajax.xml_http.send (params);
         if (onreadystatechange != null){
            try { if (document.addEventListener && ajax.xml_http.onreadystatechanged == null){ if (ajax.xml_http.readyState == 4 || ajax.xml_http.readyState == 200){ onreadystatechange(id).call(); } } }
            catch (e) { return false; }
         }

      }
      

// zisti suradnice elementu
function getXY(elem) {
   if (!elem) {
      return {"x":0,"y":0};
   }
   var xy={"x":elem.offsetLeft,"y":elem.offsetTop}
   var par=getXY(elem.offsetParent);
   for (var key in par) {
      xy[key]+=par[key];
   }
   return xy;
}
