var Request = {
    
	XMLHttpRequest: null,
   
    init: function ( ) {
		if (window.XMLHttpRequest) // Firefox et autres
			this.XMLHttpRequest = new XMLHttpRequest(); 
		else if(window.ActiveXObject){ // Internet Explorer 
			try {
				this.XMLHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				this.XMLHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			}
		} else {
			this.XMLHttpRequest = null; 
		} 
	},
	
	send: function( url, params,  callbackSuccess, callbackError ) {
		if ( this.XMLHttpRequest == null )
			this.init();
		
		if ( this.XMLHttpRequest == null ) 
			return false;
		
		var xhr = this.XMLHttpRequest;
		// using this.XMLHttpRequest fails in IE6-
		
		xhr.onreadystatechange = function() {
			if ( xhr.readyState == 4 && xhr.status == 200 ) {
				if ( callbackSuccess )
					callbackSuccess.apply(xhr);
			}
		}
		xhr.open("POST",url,true);
		xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		
		var stringParameters = '';
		for ( var id in params ) {
			if ( stringParameters != '' )
				stringParameters += '&';
			stringParameters += id+'='+params[id];
		}
		xhr.send(stringParameters);		
	}
	
}
