// ==================================================================================
// Ajax_HWU.js V1.0 - Copyright (c) 2008 IHRDC
//
// project:    Any project that uses AJAX (Asynchronous JavaScript And XML) functions
// file:       Ajax_HWU.js
// programmer: Hao Wu
// date:       2008 - 2008
//
// reference:  http://www.w3schools.com/ajax/default.asp
//
// modified:
//
// - xmlHttp.readyState
//     0: the request is not initialized
//     1: the request has been set up
//     2: the request has been setn
//     3: the request is in process
//     4: the request is complete
//
// - xmlHttp.open(param1, param2, param3)
//     param1: which method to use when sending the request (GET or POST)
//     param2: URL of the server-side script
//     param3: the request should be handled asynchronously (true or false)
//
// ==================================================================================

function GetXmlHttpObject()
{
  var xmlHttp = null;

  try
  {
    xmlHttp = new XMLHttpRequest();  // Firefox, Opera 8.0+, Safari, Internet Explorer 7.0+
  }
  catch (e)
  { // Internet Explorer
    try
    {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");  // Internet Explorer 6.0+
    }
    catch (e)
    {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");  // Internet Explorer 5.5+
    }
  }

  return xmlHttp;
}

// ==================================================================================
