var Ajax = {
	init: function() {
		xhr_object = false;
	    if (window.XMLHttpRequest) 
		{
	    	xhr_object = new XMLHttpRequest();
	    } 
		else if (window.ActiveXObject) 
		{
	     	try 
			{
	        	xhr_object = new ActiveXObject("Msxml2.XMLHTTP");
	        } 
			catch (e) 
			{
	        	try 
				{
	            	xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	            } 
				catch (e) {}
			}
		}
		if (!xhr_object) 
		{
	    	alert('Giving up :( Cannot create an XMLHTTP instance');
	        return false;
	    }
		return xhr_object;
	},
	
	requete: function(url, method, send) {
		var xhr = Ajax.init();
		if(typeof(method) == 'undefined') {
			method = "GET";
		}
		xhr.open(method,url,true); 
		if(method == 'POST') {
			xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
		}
		if(typeof(send) == 'undefined') {
			send = null;
		}
		xhr.send(send);
		return xhr;
	}
};
