//es: makeAjaxRequest("www.google.it?param1=asd", myBackFunc);

function makeAjaxRequest ( sUrl, oBackFunc, sMethod, bAsynchronous, sPostParams, mBackFuncMyParam, mBackFuncMyParam2, mBackFuncMyParam3) {
	if (typeof(sPostParams) == 'undefined') { var sPostParams = null; }
	if (typeof(sMethod) == 'undefined' || sMethod.toUpperCase() != 'GET' && sMethod.toUpperCase() != 'POST') {
		var sMethod = 'GET';
		var sPostParams = null;
	}
	if (typeof(bAsynchronous) != 'undefined' && (bAsynchronous == false || bAsynchronous == 0 || String(bAsynchronous).toUpperCase() == 'FALSE' || bAsynchronous == '0')) { bAsynchronous = false; }
	else { bAsynchronous = true; }
	
	var ajax_request = false;

	if (typeof(GF5_AJAX__MAKE_REQUEST__FAIL) == 'undefined') {
		GF5_AJAX__MAKE_REQUEST__FAIL = 'Error: Unable to execute the request.';
	}

	if (window.XMLHttpRequest) {
		// Mozilla, Safari,...
		ajax_request = new XMLHttpRequest();
		if (ajax_request.overrideMimeType) {
			ajax_request.overrideMimeType('text/html');
		}
	} else if (window.ActiveXObject) { 
		// IE
		try {
			ajax_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				ajax_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) { gf5NotifyAjaxError(GF5_AJAX__MAKE_REQUEST__FAIL+"\n\nDetails:\n"+e); }
		}
	}

	if (!ajax_request) {
		gf5NotifyAjaxError(GF5_AJAX__MAKE_REQUEST__FAIL);
		return false;
	}

	if (typeof(mBackFuncMyParam) != 'undefined') {
		ajax_request.onreadystatechange = function() { oBackFunc(ajax_request, mBackFuncMyParam, mBackFuncMyParam2, mBackFuncMyParam3); }
	}
	else {
		ajax_request.onreadystatechange = function() { oBackFunc(ajax_request); }
	}			
	ajax_request.open(sMethod, sUrl, bAsynchronous);			
	if (sMethod.toUpperCase() == 'POST') { ajax_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); }
	ajax_request.send(sPostParams);

	return ajax_request;
}


function myBackFunc(ajaxR){
	if (ajaxR.readyState == 4 && ajaxR.status == 200) {
		var sReturnedText = ajaxR.responseText;

		//your code

		alert(sReturnedText);
	}
}

