// ========================================================
// HTTP methods used by Portlets and AH
// ========================================================

/**
 * Returns an HTTP object depending on client.
 */
function httpObject() {
  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;
}

/**
 * Uses http object (h) to fetch content from url and then
 * flicks it off to a handler.
 */
function httpContent(h, url, handler) {
  h.open("GET", url, true);
  h.onreadystatechange = handler;
  h.send(null);
}

function httpPostContent(h, url, handler) {
  h.open("GET", url, true);
  h.onreadystatechange = handler;
  h.send(null);
}

