function createRequestObject()
{
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer")
    {
        ro = new ActiveXObject("Microsoft.XMLHTTP");
        try
        {
            ro = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            ro = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    else
    {
        ro = new XMLHttpRequest();
    }
    return ro;
}
var http = createRequestObject();

function sndReq(actn, param)
{
    http.open('GET', g_httproot + 'rpc.php?a=' + actn + '&p=' + param);
    http.onreadystatechange = handleResponse;
    http.send(null);
}

function sndReqEx(actn, params, mode, async)
{
    var call = g_httproot + 'rpc.php?a=' + actn + '&' + params;
    http.open(mode, call, async);
    http.onreadystatechange = handleResponse;
    http.send(null);
}

function astg(uid, t, dexp)
{
    var call = g_httproot + 'rpc.php?a=astg&uid=' + uid + "&t=" + t + "&dexp=" + dexp;
    http.open('GET', call, true);
    http.send(null);
}

function handleResponse()
{
    if(http.readyState == 4)
    {
        var r = http.responseText;
        if(r.indexOf('||') != -1)
        {
            var a = new Array();
            a = r.split('||');
            for(i=0;i<a.length;i++)
            {
                aa = a[i];
                if (aa.indexOf('>>')!=-1)
                {
                    a2 = aa.split('>>');
                    var o = getElement(a2[0]);
                    o.style.display = "block";
                    o.style.visibility = "visible";
                    o.innerHTML = a2[1];
                }
                if (aa.indexOf('<<')!=-1)
                {
                    a2 = aa.split('<<');
                    var o2 = getElement(a2[0]);
                    o2.style.display = "none";
                    o2.style.visibility = "hidden";
                }
            }
        }
    }
}

