function PopupCentrataNg(posizione,notizia,w,h,ng) {
	window.open("http://www.sardegnabiblioteche.it/index.php?xsl=879&s=2&v=9&c=5677&notizia="+notizia+"&pic="+posizione+"&ng="+ng,"","width="+w+",height="+h+",top=60,left=60,status=no,menubar=no,toolbar=no,scrollbar=no");
	return false;
}
function PopupCentrata(posizione,notizia,w,h) {
	window.open("http://www.sardegnabiblioteche.it/index.php?xsl=879&s=2&v=9&c=5677&notizia="+notizia+"&pic="+posizione,"","width="+w+",height="+h+",top=60,left=60,status=no,menubar=no,toolbar=no,scrollbar=no");
	return false;
}

function temporizza(immagine,news,ng){
	window.location.href = "http://www.sardegnabiblioteche.it/index.php?xsl=879&s=2&v=9&c=5677&slide=1&notizia="+news+"&pic="+immagine+"&ng="+ng;
}

function caricainfodl(urlimg,l,t){
      var el1 = document.getElementById("barraimg");

            if (el1) {
            el1.style.display = '';
            }

	liveReq = false;
	
	if (window.XMLHttpRequest) {
		liveReq = new XMLHttpRequest();
	}
	else if (window.ActiveXObject) {
		liveReq = new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (liveReq && liveReq.readyState < 4) {
		liveReq.abort();
	}
	liveReq.onreadystatechange = function () {
		if (liveReq.readyState == 4) {
			if (liveReq.status == 200) {

		document.getElementById("barraimg").innerHTML = liveReq.responseText;

			} 
			document.body.style.cursor = 'default';
		}
	}
	document.body.style.cursor = 'wait';
        var url = 'http://www.sardegnabiblioteche.it/index.php?xsl=870&s=2&v=9&c=5669&nodesc=1&urlimg=' + urlimg + '&l=' + l + '&t=' + t;
        //alert(url);
	liveReq.open("GET", url);
	liveReq.send(null);
	return false;
}

function intercetta() {
    for (var i=0; i<document.links.length; i++) {
        if (document.links[i].rel=="blank") {
            document.links[i].target="_blank";
        }
	}
}
addEvent(window,'load',intercetta);
/*window.onload = intercetta;*/
function addEvent(obj, evType, fn){ 
 if (obj.addEventListener){ 
   obj.addEventListener(evType, fn, false); 
   return true; 
 } else if (obj.attachEvent){ 
   var r = obj.attachEvent("on"+evType, fn); 
   return r; 
 } else { 
   return false; 
 } 
}

