/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

var xmlHttp = createXHRObj();

function createXHRObj() {
    var xmlHttp;
	try{
            xmlHttp = new XMLHttpRequest();
	}
	catch(e) {
            // assume IE6 or older
            var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP");
            for (var i=0; i<XmlHttpVersions.length && !xmlHttp; i++)  {
		try { 
                    xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
		}
		catch (e2) {
			
		}
            }
	}
        
	if (!xmlHttp) {
            alert("Error creating the XMLHttpRequest object.");
        }
	else {
            return xmlHttp;
        }
}