function createRequest()
{
    var xmlhttp;
    try
    {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e)
    {
        try
        {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(E)
        {
            xmlhttp = false;
        }
    }
    if (!xmlhttp && typeof XMLHttpRequest != "undefined")
    {
        xmlhttp = new XMLHttpRequest();
    }
    return xmlhttp;
}

function sendRequestMRC(method, path, args, handler, id)
{
    var Request = createRequest();
    if (!Request)
    {
        return;
    }
    Request.onreadystatechange = function()
    {
        if (Request.readyState == 4)
        {
            if (handler == 1)
                $.openDOMWindow({
                    windowSourceURL  : path + '?' + args,
                    borderColor: "#5381a4",
                    loader: 1,
                    loaderImagePath: "/themes/mrc/style/ajax_loader.gif",
                    loaderHeight: 16,
                    loaderWidth: 17,
                    overlayColor: "#ffffff",
                    windowBGColor: "#608ead"
                });
        }
    }
    if (method.toLowerCase() == "get" && args.length > 0)
        path += "?" + args;
    Request.open(method, path, true);
    if (method.toLowerCase() == "post")
    {
        Request.setRequestHeader("content-type", "application/x-www-form-urlencoded; charset=utf-8");
        Request.send(args);
    }
    else
        Request.send(null);
}
