// JavaScript Document
function intercetta() { 
	for (var i=0; i<document.links.length; i++) 
		if (document.links[i].className=="blank") { document.links[i].target="_blank"; } 
} 
//window.onload = intercetta;


// Sostituisce l'argomento target delle ancore, che in xhml non è previsto. 
function externalLinks() { 
	if (!document.getElementsByTagName) return; 
	
	var anchors = document.getElementsByTagName("a"); 
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		// Versione italiana. 
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "esterno") { 
			anchor.target = "_blank"; 
			if (anchor.title) anchor.title += " (Il link apre una nuova finestra)"; 
			if (!anchor.title) anchor.title = "Il link apre una nuova finestra"; 
		} 
		// Versione inglese. 
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") { 
			anchor.target = "_blank"; 
			if (anchor.title) anchor.title += " (Il link apre una nuova finestra in inglese)"; 
			if (!anchor.title) anchor.title = "Il link apre una nuova finestra in inglese"; 
		} 
	} 
} 

window.onload = function() { 
externalLinks(); // Per i links, vedi sopra. 
//intercetta();
}
