﻿function createHTTPRequest() 
{
    var xmlHttp = false;



    /*@cc_on@*/
    /*@if (@_jscript_version >= 5)

    // JScript gives us Conditional compilation, we can cope with old IE versions.
    // and security blocked creation of the objects.
    try {
        xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e) {
        try {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (e) {
            xmlHttp = false;
        }
    }
    @end@*/

    if (!xmlHttp && typeof XMLHttpRequest != 'undefined') 
    {
        try 
        {
            xmlHttp = new XMLHttpRequest();
        } 
        catch (e) 
        {
            xmlHttp = false;
        }
    }

    if (!xmlHttp && window.createRequest()) 
    {
        try 
        {
            xmlHttp = window.createRequest();
        } 
        catch (e) 
        {
            xmlHttp = false;
        }
    }

    return xmlHttp;
    
}

