function getXMLHttpRequestObject()
{
    if(window.XMLHttpRequest) return new window.XMLHttpRequest(); // IE 7, Mozilla, Safari, Firefox, Opera, most browsers
    else if(window.ActiveXObject) return new window.ActiveXObject("Msxml2.XMLHTTP"); // Create type Msxml2.XMLHTTP, if possible
    else return new window.ActiveXObject("Microsoft.XMLHTTP");
    return 0; // return 0 just in case none of the statements apply
}