
function ajaxObject(url, callbackFunction) {
	  var that=this;      
	  this.updating = false;
	  this.abort = function() {
	    if (that.updating) {
	      that.updating=false;
	      that.AJAX.abort();
	      that.AJAX=null;
	    }
	  }
	  this.update = function(fieldID,passData,postMethod,loadAJAX) { 
	    if (that.updating) { return false; }
	    that.AJAX = null;                          
	    if (window.XMLHttpRequest) {              
	      that.AJAX=new XMLHttpRequest();              
	    } else {                                  
	      that.AJAX=new ActiveXObject("Microsoft.XMLHTTP");
	      if (that.AJAX==null) {
	    	  that.AJAX=new ActiveXObject("Msxml2.XMLHTTP"); }
	    }                                             
	    if (that.AJAX==null || (typeof(loadAJAX)!='undefined' && loadAJAX==false)) {
	/*      if (typeof(loadAJAX)!='undefined') {
	    	  delete loadAJAX;
	      } */
	      return false;                               
	    } else {
	/*      if (typeof(loadAJAX)!='undefined') {
	    	  delete loadAJAX;
	      } */
	      that.AJAX.onreadystatechange = function() {  
	        if (that.AJAX.readyState==4) {             
	          that.updating=false;                
	          that.callback(fieldID,that.AJAX.responseText,that.AJAX.status,that.AJAX.responseXML, url);        
	          that.AJAX=null;                                         
	        } 
	        else if(that.AJAX.readyState==1){
	        
	          //responseText = '<p style="text-align: center;"><img src="images/Ajax/bigrotation2.gif"></p>';
	          responseText = '<div class="loadingAJAX"></div>';
	          document.getElementById(fieldID).innerHTML=responseText;	
	        }
	      }                                                        
	      that.updating = new Date();                              
	      if (/post/i.test(postMethod)) {
	        var uri=urlCall+'?'+that.updating.getTime();
	        that.AJAX.open("POST", uri, true);
	        that.AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	        that.AJAX.setRequestHeader("Content-Length", passData.length);
	        that.AJAX.send(passData);
	      } else {
	        var uri=urlCall+'?'+passData+'&timestamp='+(that.updating.getTime()); 
	        that.AJAX.open("GET", uri, true);                             
	        that.AJAX.send(null);                                         
	      }              
	      return true;                                             
	    }                                                                           
	  }
	  var urlCall = url; 
	  this.callback = callbackFunction || function () { };
	}
