
function setPost(xmlData)
{		
	var postdiv = document.createElement("div");
		
	var h4 = document.createElement("h4");
	
	var psub = document.createElement("p");
	
	var p = document.createElement("p");
	
	var a = document.createElement("a");
	
	var h5 = document.createElement("h5");
	
	a.setAttribute("id", "aclose");
	
	a.setAttribute("href", "javascript:popDown()")
	
	a.innerHTML = "chiudi"
	
	postdiv.appendChild(a);
	
	psub.setAttribute("id", "subtitle");
		
	postdiv.setAttribute("id", "post");
	
	p.setAttribute("id", "posttext");
	
	var title = xmlData.getElementsByTagName("titolo");
	
	var subtitle = xmlData.getElementsByTagName("sottotitolo");
		
	var text = xmlData.getElementsByTagName("testo");
	
	var da = xmlData.getElementsByTagName("data");
		
	h4.innerHTML = title[0].firstChild.nodeValue
	
	psub.innerHTML = subtitle[0].firstChild.nodeValue
	
	p.innerHTML = text[0].firstChild.nodeValue;
	
	h5.innerHTML = da[0].firstChild.nodeValue;	
	
	postdiv.appendChild(h4);
	
	postdiv.appendChild(h5);
	
	postdiv.appendChild(psub);
	
	postdiv.appendChild(p);
	
	document.body.appendChild(postdiv);	
	
	var height = p.offsetHeight + psub.offsetHeight + h4.offsetHeight + 100;
	
	postdiv.style.height = height + "px";
	
	window.scrollBy(0, window.innerHeight ? -window.innerHeight : - document.body.clientHeight);
	
	var left =  Math.round((window.outerWidth / 2 ) - 400);
	
	postdiv.style.left = left + "px";

}

function popUp()
{
	var thediv = document.createElement("div");
	
	thediv.setAttribute("id", "backpnl");
	
	document.body.appendChild(thediv);
	
	if(BrowserDetect.browser == "Explorer")
	{
		thediv.style.width = "4000px";
		thediv.style.height = "2000px";
		
	}
	
	var objs = document.getElementsByTagName("object");
	
	for(var i=0; i<objs.length; i++)
	{
		objs[i].style.display = "none";	
	}
	
}

function popDown()
{
	
	//non è molto bello ma funziona!!!
	
	
	var from = location.href;
	
	location.href = from;
	
}

