function ajaxObject(url, callbackFunction) {
	
	var that=this;      	
	
	this.update = function(passData,postMethod) { 
	    if (that.updating) { return false; }
	    
	    that.AJAX = null;  
	    
	    // codice per Mozilla, Firefox, Safari, and Netscape
	    if (window.XMLHttpRequest) {
			that.AJAX = new XMLHttpRequest();
			
	    } else {                
	    	
	    	    // codice per  IExplore        		    
		    try {					
			that.AJAX = new xMLHttpRequest();
		    } catch (error) {		     		    
			try {	
				// Versione 5.5 o superiore
				that.AJAX = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (error) {
				try {
					// Versione 5.5 o inferiore
					that.AJAX = new ActiveXObject("Msxml2.XMLHTTP");
				} catch(errore) {	
					alert('errore browser');					
					that.AJAX = null;											
				}	
			}
		    }
	    }	    
	    if (that.AJAX==null) { return false; }
	    		                                           		    		    
	    that.AJAX.onreadystatechange = function() {  
	        if (that.AJAX.readyState==4) {             
	          that.updating=false;                
	          that.callback(that.AJAX.responseText,that.AJAX.status,that.AJAX.responseXML);        
	          that.AJAX=null;                                         
	        }                                                      
	    }                                                        
	    
	    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.send(passData);
	    } else {
	        //var uri=urlCall+'?'+passData+'&timestamp='+(that.updating.getTime()); 
	        
	        var uri=urlCall+passData;
	        //alert(uri);
	        that.AJAX.open("GET", uri, true);                             
	        that.AJAX.send(null);                                         
	    }              
	    return true;                                             
	                                                                               
	}
	
	var urlCall = url;
	this.callback = callbackFunction || function () { };
	
	
}	

