function AjaxContent(ajax_url,content_divId,changeDisplay,loadingmsg) {
  this.changeDisplay = (changeDisplay) ? true : false;
  this.ajax_url = (ajax_url) ? ajax_url : null;
  this.content_divId = (content_divId) ? content_divId : null;
  this.loadingmsg = (loadingmsg) ? loadingmsg : null;
  this.calling_obj = null;
  this.call_back = null;
  this.return_content = false;
  this.serialized = false;
  this.show_response = false;
  this.req_type = "get";
  this.processingMsg = null;
  this.processingText = null;

  if (typeof AjaxContent._initialized == "undefined") {

    AjaxContent.prototype.setUrl = function (ajax_url) {
      this.ajax_url = ajax_url;
    };

    AjaxContent.prototype.setdivId = function (content_divId) {
      this.content_divId = content_divId;
    };

    AjaxContent.prototype.setchangeDisplay = function (myBool) {
      this.changeDisplay = myBool;
    };

    AjaxContent.prototype.setCallObj = function (calling_obj) {
      this.calling_obj = calling_obj;
    };

    AjaxContent.prototype.setCallBack = function (call_back) {
      this.call_back = call_back;
    };

    AjaxContent.prototype.closeDiv = function () {
      changeStyle(this.content_divId,'display','none');
    };

    AjaxContent.prototype.setReturnContent = function (return_content) {
      this.return_content = return_content;
    };

    AjaxContent.prototype.setSerialized = function (myBool) {
      this.serialized = myBool;
    };

    AjaxContent.prototype.setShowResponse = function (myBool) {
      this.show_response = myBool;
    };

    AjaxContent.prototype.setReqType = function (req_type) {
      this.req_type = req_type;
    };

    AjaxContent.prototype.setProcessingMsg = function (div_id,myText) {
      this.processingMsg = div_id;
      if (myText) {
        this.processingText = myText;
      }
    };

    AjaxContent.prototype.displayContent = function () {
      if (this.calling_obj.processingMsg) {
        var processingMsg = document.getElementById(this.calling_obj.processingMsg);
        changeStyle(processingMsg,"display","none");
        changeStyle(document.body,"cursor","auto");
      }
      if (this.calling_obj.return_content) {
        if (this.req.responseXML) {
          if (this.calling_obj.show_response){
            alert(this.req.responseXML);
          }
          this.calling_obj.call_back(this.req.responseXML.documentElement,this.calling_obj);
        } else if (this.req.responseText) {
          if (this.calling_obj.show_response){
            alert(this.req.responseText);
          }
          this.calling_obj.call_back(this.req.responseText);
        } else if (this.calling_obj.call_back) {
          this.calling_obj.call_back();
        }
      } else {
        if (this.req.responseText) {
          if (this.calling_obj.show_response){
            alert(this.req.responseText);
          }
          if (this.calling_obj.content_divId) {
            var myT = document.createElement('div');
            myT.innerHTML = this.req.responseText;
            parentElmt = this.calling_obj.content_divId;
            clearText(parentElmt);
            addChild(parentElmt,myT);
          }
          if (this.calling_obj.changeDisplay) {
            changeStyle(this.calling_obj.content_divId,'display','block');
          }
        }
        if (this.calling_obj.call_back) {
          this.calling_obj.call_back(this.calling_obj);
        }
      }
    };

    AjaxContent.prototype.getContent = function (par_cat,call_back,return_content,values) {
      if (this.processingMsg) {
        var processingMsg = document.getElementById(this.processingMsg);
        if (this.processingText) {
          changeText(processingMsg,this.processingText);
        }
        changeStyle(processingMsg,"display","block");
        changeStyle(document.body,"cursor","wait");
      }
      url = this.ajax_url;

      if (par_cat) {
        url += escape(par_cat);
      }
      //alert(url);
      var loader = new ContentLoader(url,this.displayContent,this.loadingmsg);
      this.loadingmsg = loader.loadingmsg;
      loader.setCallObj(this);
      if (call_back) {
        this.setCallBack(call_back);
      }
      if (this.serialized) {
        loader.setSerialized(true);
      }
      loader.setReqType(this.req_type);
      if (return_content) {
        this.setReturnContent(return_content);
      }
      loader.loadXMLDoc(null,values);
    };

    AjaxContent._initialized = true;
  }
}
