function CreaOggetto(){
	var richiesta;
	var browser = navigator.appName;
	if(browser=="Microsoft Internet Explorer"){
		richiesta = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		richiesta = new XMLHttpRequest();
	}
	return richiesta;
}

function AjaxGetUrl(method, url, ajaxID, completeFunction){
	var http = CreaOggetto();
	http.open(method,url);
	http.onreadystatechange = AjaxReadyStateChange;
	http.send(null);
	
	function AjaxReadyStateChange(){
		if(http.readyState==4){
			AjaxReadyStateComplete();
			if(completeFunction!=undefined){
				eval(completeFunction + '()');
			}
		}
	}
	
	function AjaxReadyStateComplete(){
		var response = http.responseText;
		document.getElementById(ajaxID).innerHTML = response;
	}
}


