var XMLHttpReq=function(url, callbackFunction){
  var obj=this;      
  this.updating = false;
  this.t = 0;
  this.abort = function() {
    if (obj.updating) {
      obj.updating=false;
      obj.AJAX.abort();
      obj.AJAX=null;
    }
  }
  this.update = function(passData,postMethod) { 
    if (obj.updating) { return false; }
    obj.AJAX = null;                          
    if (window.XMLHttpRequest) {              
      obj.AJAX=new XMLHttpRequest();              
    } else {                                  
      obj.AJAX=new ActiveXObject("Microsoft.XMLHTTP");
    }                                             
    if (obj.AJAX==null) {                             
      return false;                               
    } else {
      obj.AJAX.onreadystatechange = function() {  
        if (obj.AJAX.readyState==4) {             
          obj.updating=false;                
          obj.callback(obj.AJAX.responseText,obj.AJAX.status,obj.AJAX.responseXML);        
          obj.AJAX=null;                                         
        }                                                      
      }                                                        
      obj.updating = new Date();
	  obj.stamp = obj.updating.getTime();                              
      if (/post/i.test(postMethod)) {
        var uri=urlCall+'?'+obj.stamp;
        obj.AJAX.open("POST", uri, true);
        obj.AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        obj.AJAX.send(passData);
      } else {
        var uri=passData?urlCall+'?'+passData:urlCall;//+'&timestamp='+obj.stamp; 
        obj.AJAX.open("GET", uri, true);                             
        obj.AJAX.send(null);                                         
      }              
      return true;                                             
    }                                                                           
  }
  var urlCall = url;        
  this.callback = callbackFunction || function () { };
}
