// TARGET VÁLIDO

function externalLinks() {
	if (!document.getElementsByTagName) return;
	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";
	}
}

function showDiv(id){
	/*if ( id == varAtivado) {
		return
		}*/
	if (document.getElementById(id).style.display == '') {
		document.getElementById(id).style.display = 'none';
		varAtivado = false;
	} else {
		document.getElementById(id).style.display = '';
		varAtivado ? document.getElementById(varAtivado).style.display = 'none' : null;
		varAtivado = id;
	}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

window.onload = externalLinks;

var pos = location.pathname.lastIndexOf('/');
var path = location.pathname.substr(1, pos);

var base = location.protocol + '//' + location.host + '/' + path + $('script[@src$=funcoes.js]').attr('src');
base = base.replace(/([\w-_]+)\/\.\.\//, '');
base = base.replace(/\/js\/funcoes\.js$/i, '');

//var URL_BASE = base + '/';

function centraliza(w,h){
	largura = w;
	altura = h;
	if (parseInt(navigator.appVersion) >= 4) 
		window.moveTo((screen.width/2)-(largura/2+10),(screen.height/2)-(altura/2+20));
}

function zoomTXT(idDIV, NomeClasseZOOM) {
	document.getElementById(idDIV).className = NomeClasseZOOM;
}
