// FORÇA LINKS A ABRIREM EM UMA NOVA JANELA
//******************************************************************************
// A W3C não aceita mais o atributo "target" em links (tag <a>) em doctypes XHTML 1.0 Strict
// A função abaixo faz com que todos os links que possuem rel="externo" no link, abram em outra janela conforme no exemplo abaixo:
// EXEMPLO:
//******************************************************************************
//<a href="index.php" title="Link de Exemplo" rel="externo">

/* Para chamar a função, insira no body  == <script type="text/javascript">createExternalLinks();</script>  */

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')=='externo') { // <-- É necessário inserir rel="externo" no link
                anchor.target = '_blank';
                var title = anchor.title + ' (This link open in a new window)'; // <-- Insere este texto no final do Title do link
                anchor.title = title;
            }
        }
    }
}

//........................................................................
//........................................................................
