// JavaScript Document
/*
Properties
onreadystatechange - Specifys the event handler to be called when the readyState property changes.
readyState - represents the state of the request (ro)
responseBody - represents the results of the response as an array of unsigned bytes (ro)
responseStream - represents the results of the response as an IStream (ro)
responseText - represents the results of the response as a string (ro)
responseXML - represents the results of the response as parsed by the Microsoft XML Parser (ro)
status - The HTTP Status code returned by request (ro)
statusText - represents the HTTP response line status (ro)

Methods
abort
getAllResponseHeaders
getResponseHeader
open (method, url, boolAsync, bstrUser, bstrPassword) - (method Get, Post, Put, Profind)
send(varBody)
setRequestHeader(bstrHeader, bstrValue)
*/

function old_getHTTPObject() {
  var xmlhttp;
/*@cc_on
  @if (@_jscript_version >= 5)
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
      xmlhttp = false;
    }
  }
  @else
    xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}

function getHTTPObject() {
	var http_request = false;
	
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	
	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	} else {
		return http_request
	}
}