  // Javascript calls it a function, but this acts like the class.
  // i.e., xyz = new AjaxObj();
  function AjaxObj()
  {
    var req;
    var handler_function;
    var extra;

    this.generateRequest = function(uri, handler, extra_data)
    {
//     if (!req)
      {
        handler_function = handler;
	
	if (extra_data) {
	  extra = extra_data;
	}

	try {
          req = new XMLHttpRequest();
	} catch (e) {
	  req = new ActiveXObject("Msxml2.XMLHTTP");
	}


        req.open("GET",uri,true);
        req.onreadystatechange = this.callbackFunction;
//	req.onerror = this.errorHandler

	showAjax2BusyBox();
        req.send(null);
      }
/*      else
      {
	//alert(req.readyState);
        alert('Please Wait, already processing request');
      }
*/
      return false;
    }

    this.callbackFunction = function()
    {
        if (req.readyState == 4)
        {
	  var response = req.responseText;
          var status = req.status;
	  req = null;

          if (status == 401)
          {
	    alert('Error 401: Reload Page To Log-In');
	    top.location.reload();
          }
          else if (!handler_function)
            alert(response);
          else
	    hideAjax2BusyBox();
            handler_function(response, extra);
        }
    }
  }


  function showAjax2BusyBox()
  {
    var box = document.getElementById('ajax2busybox');

    if (box != null) {
	    //Mouse positions come from helper.js
	    box.style.top = helper_curMouseY() - (box.style.height / 2);
	    box.style.left = helper_curMouseX() - (box.style.width / 2);

	    helper_fadeObject('ajax2busybox',0,0.1);
    }
  }

  function hideAjax2BusyBox()
  {
    var box = document.getElementById('ajax2busybox');

    if (box != null) { helper_fadeObject('ajax2busybox',1,-0.05);}
  }




