function loadcode(tmpUrl) {
    //ricavo le substringhe memorizzate nel path che servono x costruire la stringa bianca della pos.    
	divurl="content";
	//alert (tmpUrl);
	// NUOVO: loadcode (' nomefile @1 ID @2 titolo @3 imgsopra')
	p1=tmpUrl.indexOf("@1")
	p2=tmpUrl.indexOf("@2")
	path=tmpUrl.substring(0,p1);
	id=tmpUrl.substring(p1+2,p2);
	tit=tmpUrl.substring(p2+2);
	img="";
        
	if (tit.indexOf("@3")>0)
		{
		imgpos=tit.indexOf("@3");
		img=tit.substring(imgpos+2);
		tit=tit.substring(0,imgpos);
		document.getElementById('imgsopra').src="img/top_img/015.jpg"
		}
	//alert (path + "\n" + id + "\n" + tit + "\n" + img);
	//alert ("nuovo: " + id + "\n" + tmpUrl);
	//dhtmlHistory.add(id, tmpUrl);	//imposto un punto della cronologia
        
	if (path.indexOf(".php")==-1)
		{basepath="custom_files/pagine/";
		st='?ID=' + Math.random();
                
                }
	else
		{basepath="";
		st="";}
	path= basepath + path + st;
	//alert (path);
	stprima='<DIV id="news-stage">';
	stdopo='</DIV>';	
	stpos='<div id="we_are_here"><a href="index.php">Home</a> > ' + tit + '</div>'
			
	var req = assegnaXMLHttpRequest();
        //alert(path);
        //document.getElementById(divurl).innerHTML = 'test';exit;
    if (req) {
     
		req.onreadystatechange = function() {
			if (req.readyState == 4 && req.status == 200) {
				var frameSel = document.getElementById(divurl);
				//alert (frameSel.value);
				//ti restituisce la pagina html in formato testo e te la mette nella variabile che gli hai detto sopra
				frameSel.innerHTML=stprima+req.responseText+stdopo;
				$.each($(".lightbox"), function(){
					$("#" + $(this).attr("rel")).lightBox({
							imageBtnClose: 'img/lightbox-btn-close.gif',
							imageBtnPrev: 'img/lightbox-btn-prev.gif',
							imageBtnNext: 'img/lightbox-btn-next.gif',
							imageBlank: 'img/lightbox-blank.gif',
							imageLoading: 'img/lightbox-loading.gif'
					});
					//alert($(this).attr("rel"));
				});
			}
		};
     req.open('GET', path);   
     req.send(null);  
    }
	
  }
   
         
   
  function assegnaXMLHttpRequest() {
	var
    XHR = null,
    browserUtente = navigator.userAgent.toUpperCase();
	if(typeof(XMLHttpRequest) === "function" || typeof(XMLHttpRequest) === "object")
		XHR = new XMLHttpRequest();
	else if(window.ActiveXObject && browserUtente.indexOf("MSIE 4") < 0) {
		if(browserUtente.indexOf("MSIE 5") < 0)
			XHR = new ActiveXObject("Msxml2.XMLHTTP");
		else
			XHR = new ActiveXObject("Microsoft.XMLHTTP");
		}
		return XHR;
   }

