	//========================================================
	// Event Listener by Scott Andrew - http://scottandrew.com
	// edited by Mark Wubben, <useCapture> is now set to false
	//http://simon.incutio.com/archive/2004/05/26/addLoadEvent
	//========================================================
	// INICIA FUNÇÃO DE JAVASCRIPT SEM CHAMADA NO BODY
	//

function init() {
	createExternalLinks();
	verPag();
	}
	
	

// FORÇA LINKS A ABRIREM EM UMA NOVA JANELA
//******************************************************************************
// A W3C não aceita mais o atributo "target" em links (tag <a>) à partir do XHTML 1.0
// 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:
//******************************************************************************

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') { 
                anchor.target = '_blank';
                var title = anchor.title + ' (Este link abre uma nova janela)'; 
                anchor.title = title;
				
            }
        }
    }
}

//........................................................................
//........................................................................
	
	
// GET PAGE
// ..................................................................................
function getPage()
{
	v = window.document.URL.split('/');	
	pag = v[v.length-1];
	nome = pag.split('.')[0];
	return nome;
}

function setClass(obj, classe)
{
	obj.className = classe;
}

function verPag()
{
	pag = getPage();
	if(pag=='')
		pag = 'default';	
	obj = document.getElementById(pag);
	setClass(obj,'selected');
}

// ..................................................................................
// ..................................................................................
	
	
	
	
	
	
	
	
	
	
	
	
function amplia_imagem( imagem, title ) {
	PositionX = 0;
	PositionY = 0;
	window.open('fotos.asp?img=' + imagem + '&title=' + title, '', 'resizable=1,scrollbars=no,width=100,height=100,left='+PositionX+',top='+PositionY);
}
	
	
	
	
	
	
	
//........................................................................
//........................................................................

//========================================================
// Event Listener by Scott Andrew - http://scottandrew.com
// edited by Mark Wubben, <useCapture> is now set to false
//http://simon.incutio.com/archive/2004/05/26/addLoadEvent
//========================================================
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;

    }
}

if ( navigator.appName != "Netscape" )
	window.attachEvent("onload", init);
else
	addEvent(window, "load", init);
