// ADICIONA EVENTOS ONLOAD
function addLoadEvent(func) {
	var oldonload = window.onload;
	
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			
			func();
		}
	}
}

// ADICIONA A TAG TARGET="_BLANK" PARA LINKS QUE ABREM EM NOVA JANELA
function createExternalLinks() {
    if (document.getElementsByTagName) {
        var anchors = document.getElementsByTagName("a");
        for (var i=0; i<anchors.length; i++) {
            var anchor = anchors[i];
            if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") { // <-- É necessário inserir rel="externo" no link
                anchor.target = "_blank";
                //var title = anchor.title + ' (Este link abre uma nova janela)'; // <-- Insere este texto no final do Title do link
                //anchor.title = Trim(title);
            }
        }
    }
}

addLoadEvent(createExternalLinks);
