/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
// 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.
}
