//<![CDATA[
function isXmlHTTPNull(pObjXmlHTTP)
{
    if (pObjXmlHTTP == null)
    {
        alert(strErrorXMLHTTPNoSupport);
        return false;
    }
}

// Process the XML request for AJAX.
function doXMLRequest(pObjXmlHTTP, pStrUrl, pStrAction, pBoolAsync, pStrContentType, pStrFunctionNameGood, pStrFunctionNameBad)
{
    pObjXmlHTTP.open(pStrAction.toUpperCase(), pStrUrl, pBoolAsync);

    pObjXmlHTTP.setRequestHeader("Connection", "close");
    if ((pStrContentType != null) && (pStrContentType != undefined) && (pStrContentType.length > 0))
        pObjXmlHTTP.setRequestHeader("Content-type", pStrContentType);

    pObjXmlHTTP.onreadystatechange = function()
        {
            // Check to see if the document is ready to parse.
            if (pObjXmlHTTP.readyState == 4)
            {
                // Check to see if the request is successful.
                if (pObjXmlHTTP.status == 200)
                {
                    if ((pStrFunctionNameGood != null) && (pStrFunctionNameGood != undefined) && (pStrFunctionNameGood.trim().length > 0))
                        eval(pStrFunctionNameGood);
                }
                else
                {
                    logMsg("Ajax request not successfull. (status: " + pObjXmlHTTP.status + " - " + pObjXmlHTTP.statusText + ")", "severe", "xmlHTTP.js (doXMLRequest)");
                    alert(strErrorXMLHTTP + " " + pObjXmlHTTP.status + " (" + pObjXmlHTTP.statusText + ")");
                    if ((pStrFunctionNameBad != null) && (pStrFunctionNameBad != undefined) && (pStrFunctionNameBad.trim().length > 0))
                        eval(pStrFunctionNameBad);
                }
            }
        };
    pObjXmlHTTP.send(null);
}

// Get the XML HTTP object for AJAX.
function getNewXmlHTTPObject()
{
    var objTempXmlHttp = null;
    try
    {
        // Firefox, Opera 8.0+, Safari
        objTempXmlHttp = new XMLHttpRequest();
    }
    catch (e)
    {
        // Internet Explorer
        try
        { objTempXmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }
        catch (e)
        { objTempXmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }
    }

    return objTempXmlHttp;
}
//]]>
