
    function AJAXmakeRequest(url, data, returnFunc, returnFuncParam) {
        var http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/plain');
                // See note below about this line
            }
        } 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('Vás prehliadač nepodporuje dynamické čítanie dát');
            return false;
        }
        http_request.onreadystatechange = function() { returnFunc(http_request, returnFuncParam); };
        http_request.open('POST', url, true);
        http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        //http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-2");
        http_request.send(data);

    }

    function AJAXmakeRequestGet(url, returnFunc, returnFuncParam) {

        var http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/plain');
                // See note below about this line
            }
        } 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('Giving up. Cannot create an XMLHTTP instance');
            return false;
        }
        http_request.onreadystatechange = function() { returnFunc(http_request, returnFuncParam); };
        http_request.open('GET', url, true);
        http_request.send(null);

    }

    function hideAll(pc){
       var i;
       for(i=0;i<pc;i++){
            var elm = document.getElementById("odpoved_"+i);
            elm.style.display = 'none';
       }
    }
    
    function hideH(id,pc){
      var parseid = id.split('_')[1];
      var i;
      for(i=0;i<pc;i++){
          if(parseid != i){
            var elm = document.getElementById("odpoved_"+i);
            elm.style.display = 'none';
            document.getElementById("sipka_"+i).src = "/images/sipka_ep.gif";
          }else{
            var elm = document.getElementById("odpoved_"+parseid);
            elm.style.display = 'block';
            document.getElementById("sipka_"+i).src = "/images/sipka_ep_down.gif";
          }
      }
    }
    
// skryvanie / odkryvanie obsahu contentov

		function indexpageSwitch(id, state) {
		    vis = state ? (state == "hide") : (document.getElementById('indexText' + id).style.display != "none");
		    if (document.getElementById('indexText' + id))
		        document.getElementById('indexText' + id).style.display = vis ? "none" : "block";
		    if (document.getElementById('indexMeta' + id))
		        document.getElementById('indexMeta' + id).style.display = vis ? "none" : "block";		        
		}
		
		var allShowing = false;
		function indexpageSwitchAll(actDiv) {
		    var container = document.getElementById('indexList');  
		    if (container) {    
		        var divs = container.getElementsByTagName('div');
		        var patt = /indexMeta(.*)/;
		        for (var i = 0; i < divs.length; i++) {
		            var div_id = divs.item(i).id;
		            if (div_id && patt.test(div_id)) {
		                var item_id = patt.exec(div_id)[1];
		                //alert(item_id);
		                var por = 'indexMeta'+item_id;
		                if(actDiv != por)
		                {
		                	indexpageSwitch(item_id, "hide");
		                	document.getElementById('sipka'+item_id).src = "/images/sipka_ep.gif";
		                }
		            }
		        }
		        allShowing = !allShowing;
		    }
		}
    
    function hideMyDiv(myDiv,sipkaid)
    {			
			if(document.getElementById(myDiv).style.display == 'none')
			{
				document.getElementById(myDiv).style.display = 'block';
				document.getElementById(sipkaid).src = "/images/sipka_ep_down.gif";
			}
			else
			{
				document.getElementById(myDiv).style.display = 'none';
				document.getElementById(sipkaid).src = "/images/sipka_ep.gif";
			}			
			indexpageSwitchAll(myDiv);			
		}
