   var http_request = false;
   
   function makePOSTRequest(url, parameters,ajaxout) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      
      if (ajaxout!==null){

      http_request.onreadystatechange =  function() { alertContents(ajaxout); };
      }
      
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

   function alertContents(ajaxout) {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            document.getElementById(ajaxout).innerHTML = result;            
         } else {
            alert('There was a problem with the request.');
         }
      }
   }
   //script name without php, varname = variable name we need, my id from, ajaxout=out id
   function ajaxfromid(script,varname,myid,ajaxout) {
      var poststr = varname+"=" + encodeURI( document.getElementById(myid).value );
      makePOSTRequest(script+'.php', poststr,ajaxout);
   }

      //add str from parameter  - freestyle for ucitel
   function uloha(a,x,b,y,ajaxout) {
      var poststr = a+"=" + encodeURI(x) + "&"+b+"="+ encodeURI(y);
      makePOSTRequest('/sigsmaker.php', poststr,ajaxout);
   } 
   
   //add str from parameter
   function ajaxfromtext(script,varname,str,ajaxout) {
      var poststr = varname+"=" + encodeURI(str);
      makePOSTRequest(script+'.php', poststr,ajaxout);
   } 
   
   //add wholeform 
   function ajaxfromform(script,ajaxout){
      var poststr = $("form").serialize();
                 poststr=encodeURI(poststr);
      //poststr = encodeURI(poststr);
      //document.getElementById(ajaxout).innerHTML = poststr;
      makePOSTRequest(script+'.php', poststr,ajaxout);
   }
   


  function login(showhide){
    if(showhide == "show"){
        document.getElementById('popupbox').style.visibility="visible"; /* If the function is called with the variable 'show', show the login box */
    }else if(showhide == "hide"){
        document.getElementById('popupbox').style.visibility="hidden"; /* If the function is called with the variable 'hide', hide the login box */
    }
  }



function zobrazSkryj(idecko){
  el=document.getElementById(idecko).style;
  el.display=(el.display == 'block')?'none':'block';
}



function changeIt()
{
 document.write("a");
}
