﻿var xmlHttpObject;
    
function xmlHttpGet(xh, url, handler)
{
  if (xh)
  {
    xh.open('GET', url, true);
	if (handler)
	{
	  xh.onload = handler;
      xh.onerror = handler;
	}
    xh.send(null);
  }
} 

function getXmlHttpObject(handler) 
{
  var xh = null;    //Holds the local xmlHTTP object instance
        
  if (window.ActiveXObject) 
  {
	 // use the ActiveX control for IE5.x and IE6 and (in this case) IE7
     xh = new ActiveXObject("Microsoft.XMLHTTP"); 
     xh.onreadystatechange = handler;
  }
  else if (window.XMLHttpRequest) 
  {
    // IE7, Mozilla, Safari, and so on: Use native object
    xh = new XMLHttpRequest();
    xh.onload = handler;
    xh.onerror = handler;
  }

  //Return the instantiated object
  return xh;
}

