function getHTTPObject()
{
        var req;

        try
        {
                if (window.XMLHttpRequest)
                {
                        req = new XMLHttpRequest();

                        if (req.readyState == null)
                        {
                                req.readyState = 1;
                                req.addEventListener("load", function () {
                                        req.readyState = 4;

                                        if (typeof req.onreadystatechange == "function")
                                        req.onreadystatechange();
                                }, false);
                        }

                        return req;
                }

                if (window.ActiveXObject)
                {
                        var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"];

                        for (var i = 0; i < prefixes.length; i++)
                        {
                                try
                                {
                                        req = new ActiveXObject(prefixes[ i ] + ".XmlHttp");
                                        return req;
                                } catch (ex) {};
                        }
                }
        } catch (ex) {}

        alert("XmlHttp Objects not supported by client browser");
}

function objetoAjax(){
	var xmlhttp=false;
	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;
}

