var sezione

function caricaPagina(pagina)
{

var layer=document.getElementById("layer_a");

if(layer==null)
	
	{
	newDiv = document.createElement("div");
	newDiv.setAttribute("id", "layer_a");
	var foot = document.getElementById("contenuti");
	foot.appendChild(newDiv);
	}

sezione=aproConnessione();
if (sezione==null)
	{
	alert ("il tuo browser non supporta un cazzo");
	return;
	}
var url=pagina+".pag";
sezione.onreadystatechange=connessionePronta;
sezione.open("GET",url,true);
sezione.send(null);
document.getElementById("location_title").innerHTML=pagina;
}

function connessionePronta()
{
	if (sezione.readyState==4 || sezione.readyState=="complete")
	{
	document.getElementById("layer_a").innerHTML=sezione.responseText;
	}
}


function aproConnessione()
{
var sezione=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  sezione=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    sezione=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    sezione=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return sezione;
}




function addLayer()
{	
	newDiv = document.createElement("div");
	newDiv.innerHTML = "";
	newDiv.setAttribute("id", "layer_a");
	//<!--newDiv.style.position = "absolute";
	//newDiv.style.top = "300px";
	//newDiv.style.zIndex = "20";!-->
	var foot = document.getElementById("contenuti");
	foot.appendChild(newDiv);
	loadContent(url_sezione);
	}

function removeLayer(id) {
	id.parentNode.removeChild(id);
	}