function getXMLHTTPRequest()
        {
            try
            {
                req = new XMLHttpRequest();
            }
            catch (err1)
            {
                try
                {
                    req = new ActiveXObject("Msxml2.XMLHTTP");
                }
                catch (err2)
                {
                    try
                    {
                        req = new ActiveXObject("Microsoft.XMLHTTP");
                    }
                    catch (err3)
                    {
                        req = false;
                    }
                }
            }
            return req;
        }
        
        var http = getXMLHTTPRequest();
    
    function askDel(nid,mod,nral) {
        if (mod==1)
        {
            /* ask */
            document.getElementById('delNews'+nid).innerHTML='Are you sure? <a href="javascript:incarca(\'deletenews.php?id='+nid+'&nral='+nral+'\')">Yes</a> <a href="javascript:askDel('+nid+',2,'+nral+')">No</a>';
        }
        else
        {
            /* show del button */
            document.getElementById('delNews'+nid).innerHTML='<a href="javascript:askDel('+nid+',1,'+nral+')"><img src="img/b_trash.png" border="0" alt="Delete" title="Delete news"></a>';
        }
    }
    
    function requestPage(adresa) {
        myRand = parseInt(Math.random()*999999999999999);
        var modurl = adresa+"&rand="+myRand;
        http.open("GET", modurl, true);
        http.onreadystatechange = useHttpResponse;
        http.send(null);
        parent.location.hash = modurl;
    }

    
    function useHttpResponse()
        {
            if (http.readyState == 4)
            {
                if (http.status == 200)
                {
                        
                        document.getElementById('content').innerHTML = http.responseText;
                        
                }
            }
            else
            {
                
                    document.getElementById('content').innerHTML = '<div style="margin: 20px" align="center">Loading...</div>';
            }
        }

