function ajaxObj() {
 
 this.createAJAX = function() {
   this.req = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP"): new XMLHttpRequest();   
  }

 this.resetAJAX = function() {
   this.req   = null;
   this.method    = 'GET';
   this.url       = '';
   this.onLoaded  = function() { };
   this.onLoading = function() { };
   this.response  = '';
   this.responseXML  = '';
   this.postdata = '';
  }
  
 this.runAJAX = function() {
   tthis = this;
   this.req.open(this.method,this.url,true);

   if (this.method=='POST') {
     this.req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    }

   this.req.onreadystatechange = function() {
     if (tthis.req.readyState == 1) {
       tthis.onLoading();
      }
     if (tthis.req.readyState == 4) {
       tthis.response    = tthis.req.responseText;
       tthis.responseXML = tthis.req.responseXML;
       tthis.onLoaded();
      }
    }
   if (this.method == 'POST') {
	 var string = 'postdata='+encodeURIComponent(this.postdata);
     this.req.send(string);
    } else {
     this.req.send(null);
    } 
  }

 this.resetAJAX();
 this.createAJAX();

}
