function displayContent() {
	var argTot    = displayContent.arguments.length;
	if (argTot >= 2) {
		
		var _replaceAction = displayContent.arguments[0];
		//
		loading(_replaceAction);
		var myArgs    = new Array();
		var ADD_URL   = '';
		var c = 0;
		for (var i = 1;i < argTot;i++) {
			myArgs[c] = displayContent.arguments[i]
			c++;
		}		
		ADD_URL      = myArgs.join('&');
		var get_url  = "../ajax.engine.php"+'?'+ADD_URL;
		var oXmlHttp = zXmlHttp.createRequest();
	  oXmlHttp.open("get", get_url, true);
	  oXmlHttp.onreadystatechange = function () {
			if (oXmlHttp.readyState == 4) {
				if (oXmlHttp.status == 200) {
					if (oXmlHttp.responseText != "") {
						contentReplace(_replaceAction, oXmlHttp.responseText);
					}
				} else {
					alert("An error occurred: " + oXmlHttp.statusText); //statusText is not always accurate
				}
			}            
	  };
	  oXmlHttp.send(null);
	}
}

function contentReplace(_replaceAction, _Html){
	var idReplace;
	idReplace = _replaceAction;
	document.getElementById(idReplace).innerHTML = _Html; // Inserisco il contenuto
}

function loading(_replaceAction) {
	//document.getElementById(idElementReplace).innerHTML = "<img src='img/loading.gif'>"
	var tmpLen    = _replaceAction.indexOf("#");
	var idReplace;
	if (tmpLen >= 1) {
		idReplace = (_replaceAction.substr(0,tmpLen));
	} else {
		idReplace = _replaceAction;
	}
	document.getElementById(idReplace).innerHTML = "<span style='background-color:#380903;font-size:10px;font-family:Verdana;color:white;font-weight:bold;text-align:center;'>Loading...</span>"
}

// Send data with JQUERY
function JQ_send(_file, my_data, _method) {
	var my_html = $.ajax({
		url:  _file,
		type: _method,
		cache: false,
		dataType: 'text',
		data: my_data,
		timeout: 3000,
		async: false
	}).responseText;
	return my_html;
}


