function funzioneAjaxInnerHTML(destinazione, url) {
	var d_layer; // Layer di destinazione, specificato dal parametro "destinazione"
	var caricamento; // Questa variabile contiene il codice HTML che mostra la gif di caricamento.
	var xmlHttp;

	d_layer = document.getElementById(destinazione); // Acquisisce il layer di destinazione
	
	try	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	} catch (e) {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState == 4) {
			d_layer.innerHTML = xmlHttp.responseText;
			var x = d_layer.getElementsByTagName("script");   
			for(var i=0;i<x.length;i++)  
			{eval(x[i].text);}  
		}
	}

	caricamento = "<div id=\"caricamento\"><img src=\"/images/loading2.gif\" /><h1>Attendere...</h1></div>";
	d_layer.innerHTML = caricamento;

	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function funzioneAjaxValue(destinazione, url) {
	var d_layer; // Layer di destinazione, specificato dal parametro "destinazione"
	var caricamento; // Questa variabile contiene il codice HTML che mostra la gif di caricamento.
	var xmlHttp;

	d_layer = document.getElementById(destinazione); // Acquisisce il layer di destinazione
	
	try	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	} catch (e) {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState == 4) {
			d_layer.value = xmlHttp.responseText;
		}
	}

	caricamento = "Loading...";
	d_layer.value = caricamento;

	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function switchLanguage(lang) {
    u = location.href.split('/');
    u[3] = lang;
    location.href = u.join('/');
}

function mostra(id) {
	var summary, body, hidden_summary, hidden_body;
	summary = document.getElementById('summary_'+id);
	body = document.getElementById('body_'+id);
	hidden_summary = document.getElementById('hidden_summary_'+id);
	hidden_body = document.getElementById('hidden_body_'+id);
	
	summary.innerHTML = '';
	body.innerHTML = hidden_body.innerHTML;
}

function nascondi(id) {
	var summary, body, hidden_summary, hidden_body;
	summary = document.getElementById('summary_'+id);
	body = document.getElementById('body_'+id);
	hidden_summary = document.getElementById('hidden_summary_'+id);
	hidden_body = document.getElementById('hidden_body_'+id);
	
	summary.innerHTML = hidden_summary.innerHTML;
	body.innerHTML = '';
}
