function ZeraListaCombo(cmb)
{
	for (x = cmb.options.length - 1; x > 0; x--){ 
		cmb.options[x] = null;
	}
	cmb.options.length = 1;
}
function TrfValidaCPF(Num) { 
	var Numero = "";
	var Digito = "";
	if((Num.value=="11111111111")||
	  (Num.value=="22222222222")||
	  (Num.value=="33333333333")||
	  (Num.value=="44444444444")||
	  (Num.value=="55555555555")||
	  (Num.value=="66666666666")||
	  (Num.value=="77777777777")||
	  (Num.value=="88888888888")||
	  (Num.value=="99999999999")||
	  (Num.value=="00000000000")){
		return false;
	  }
	  
	Numero = Numero + "" + Num.value.substring(0,9);
	Digito = Digito + "" + Num.value.substring(9,11);
	var j = -1;
	var CPF = Numero;
	var peso1 = '100908070605040302';
	var peso2 = '111009080706050403';
	var soma1 = 0;
	var soma2 = 0;
	var digito1 = 0;
	var digito2 = 0;
		
	for (i = 1; i < 9 - Numero.length+1; i++) {
		CPF = eval("'" + 0 + CPF + "'")}
		
	for (i = 1; i < CPF.length+1; i++) {
		j = j + 2;
		soma1 += CPF.substring(i, i-1) * peso1.substring(j-1, j+1);
		} 
		soma1 %= 11;
	
		if (soma1  < 2) {
		   digito1 = 0;}
		else {
		   digito1 = 11 - soma1; }
	
		j = -1; 
	for (i = 1; i < CPF.length+1; i++) {
		j = j + 2;
		soma2 += CPF.substring(i, i-1) * peso2.substring(j-1, j+1);
		} 
		soma2 += digito1 * 2 
		soma2 %= 11;
	
		if (soma2  < 2) {
		   digito2 = 0;}
		else {
		   digito2 = 11 - soma2; }
	
	if (eval("'" + digito1 + digito2 + "'") != Digito){
		return false;}
	else {
		return true;}
}
function TrfValidaCNPJ(c) {
    var numeros, digitos, soma, i, resultado, pos, tamanho, digitos_iguais, cnpj = c.value.replace(/\D+/g, '');
    digitos_iguais = 1;
    if (cnpj.length != 14){
		//alert('CNPJ inválido');
		//c.focus();
		return false;
    }
	for (i = 0; i < cnpj.length - 1; i++){
		if (cnpj.charAt(i) != cnpj.charAt(i + 1)){
			 digitos_iguais = 0;
			 break;
		}
	}
	if (!digitos_iguais){
		tamanho = cnpj.length - 2
		numeros = cnpj.substring(0,tamanho);
		digitos = cnpj.substring(tamanho);
		soma = 0;
		pos = tamanho - 7;
		for (i = tamanho; i >= 1; i--)
		{
			soma += numeros.charAt(tamanho - i) * pos--;
			if (pos < 2)
			pos = 9;
		}
		resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
		if (resultado != digitos.charAt(0))
		{
			//alert('CNPJ inválido');
			//c.focus();
			return false;
		}
		tamanho = tamanho + 1;
		numeros = cnpj.substring(0,tamanho);
		soma = 0;
		pos = tamanho - 7;
		for (i = tamanho; i >= 1; i--)
		{
			soma += numeros.charAt(tamanho - i) * pos--;
			if (pos < 2)
			pos = 9;
		}
		resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
		if (resultado != digitos.charAt(1)){
			//alert('CNPJ inválido');
			//c.focus();
			return false;
		}
		else {
			// alert('CNPJ  OK !');
			return true;
		}
	}
	else{
		//alert('CNPJ inválido');
		//c.focus();
		return false;
	}
} 
function imprime_barra8(){
	Layout_barra = '<center><table cellpadding=0 cellspacing=0 width=100%><tr><td nowrap><img src=/Layout/TRF1_Bar8_Inicio.gif height=10 width=4><img src=/Layout/TRF1_bar8.gif height=10 width=99%><img src=/Layout/TRF1_Bar8_Fim.gif height=10 width=4></td></tr></table></center>';
	document.write (Layout_barra);
}
function imprime_barra_intranet_sup(param){
	Layout_barra = '<TABLE BORDER=0 width=100% CELLPADDING=0 CELLSPACING=0 align=\'center\'>'
				+'  <tr height=24>'
				+'    <td width=6 height=24 valign=top><img src=/Layout/TRF1_Bar24Sup_Inicio.gif width="6" height="24"></td>'
				+'    <td width=200 background=/Layout/TRF1_Bar24Sup.gif align=left  ><font size=1> '
				+'    <a href="#" onclick="autenticacao(\''+param+'\');">'
				+'    <img src="/Layout/TRF1_Bar24Sup_Admin.gif" alt="Visualizar Documentos" width="24" height="24" border=0 ></a> '
				+'      </font></td>'
				+'    <td width=993 background=/Layout/TRF1_Bar24Sup.gif align=right><font size=1>&nbsp; '
				+'      </font></td>'
				+'    <td width=11 height=24 valign=top><img src=/Layout/TRF1_Bar24Sup_fim.gif><font size=1>&nbsp;</font></td>'
				+'  </tr>'
				+'</table>';
	document.write (Layout_barra);
}
function imprime_barra_intranet_inf(param){
	Layout_barra = '<TABLE BORDER=0 width=100% CELLPADDING=0 CELLSPACING=0 align=\'center\'>'
				+'  <tr height=24>'
				+'    <td width=6 height=24 valign=top><img src=/Layout/TRF1_Bar24Inf_Inicio.gif width="6" height="24"></td>'
				+'    <td width=200 background=/Layout/TRF1_Bar24Inf.gif align=left  ><font size=1> '
				+'    <a href="#" onclick="autenticacao(\''+param+'\');">'
				+'      <img src="/Layout/TRF1_Bar24Inf_Admin.gif" alt="Visualizar Documentos" width="24" height="24" border=0> '
				+'      </a></font></td>'
				+'    <td width=993 background=/Layout/TRF1_Bar24Inf.gif align=right><font size=1>&nbsp; '
				+'      </font></td>'
				+'    <td width=11 height=24 valign=top><img src=/Layout/TRF1_Bar24Inf_fim.gif><font size=1>&nbsp;</font></td>'
				+'  </tr>'
				+'</table>';
	document.write (Layout_barra);
}
function imprime_barra_intranet_sup11(param,param1){
	layout_barra = '<TABLE BORDER=0 width=100% CELLPADDING=0 CELLSPACING=0 align=\'center\'>'
				+'  <tr height=24>'
				+'    <td width=6 height=24 valign=top><img src=/Layout/trf1_Bar24Sup_Inicio.gif width="6" height="24"></td>'
				
				+'    <td width=200 background=/Layout/trf1_Bar24Sup.gif align=left  ><font size=1> '
				+'    <a href="#" onclick="autenticacao(\''+param+'\');">'
				+'    <img src="/Layout/trf1_Bar24Sup_Admin.gif" alt="Visualizar Documentos" width="24" height="24" border=0 ></a> '
				+'      </font></td>'
				
				+'    <td width=993 background=/Layout/trf1_Bar24Sup.gif align=right><font size=1>&nbsp; '
				+'      </font></td>'
				
				
				+'    <td width=20 background=/Layout/trf1_Bar24Sup.gif align=left  ><font size=1> '
				+'    <a href="'+param1+'">'
				+'    <img src="/Layout/Trf1_Bar24Sup_Pesquisa.gif" alt="Selecionar Seção/Subseção Judiciária" width="24" height="24" border=0 ></a> '
				+'      </font></td>'
				
				+'    <td width=11 height=24 valign=top><img src=/Layout/trf1_Bar24Sup_Fim.gif><font size=1>&nbsp;</font></td>'
				+'  </tr>'
				+'</table>';
	document.write (layout_barra);
}
function imprime_barra_intranet_inf11(param,param1){
	layout_barra = '<TABLE BORDER=0 width=100% CELLPADDING=0 CELLSPACING=0 align=\'center\'>'
				+'  <tr height=24>'
				+'    <td width=6 height=24 valign=top><img src=/Layout/trf1_Bar24Inf_Inicio.gif width="6" height="24"></td>'
				+'    <td width=200 background=/Layout/trf1_Bar24Inf.gif align=left  ><font size=1> '
				+'    <a href="#" onclick="autenticacao(\''+param+'\');">'
				+'      <img src="/Layout/TRF1_Bar24Inf_Admin.gif" alt="Visualizar Documentos" width="24" height="24" border=0> '
				+'      </a></font></td>'
				+'    <td width=993 background=/Layout/trf1_Bar24Inf.gif align=right><font size=1>&nbsp; '
				+'      </font></td>'
				+'    <td width=20 background=/Layout/trf1_Bar24Inf.gif align=left  ><font size=1> '
				+'    <a href="'+param1+'">'
				+'    <img src="/Layout/Trf1_Bar24Inf_Pesquisa.gif" alt="Selecionar Seção/Subseção Judiciária" width="24" height="24" border=0 ></a> '
				+'      </font></td>'
				+'    <td width=11 height=24 valign=top><img src=/Layout/trf1_Bar24Inf_Fim.gif><font size=1>&nbsp;</font></td>'
				+'  </tr>'
				+'</table>';
	document.write (layout_barra);
}
function imprime_barra24_sup(){
	layout_barra = '<TABLE BORDER=0 width=100% cellspacing=0 cellpadding=0>'
				+'<tr height=24><td width=1 height=24 valign=top>'
				+'<img src=/Layout/trf1_bar24sup_inicio.gif></td>'
				+'<td background=/Layout/trf1_bar24sup.gif valign=top align=right>'
				+'<a href="javascript:history.back(-1)">'
				+'<img src="/Layout/TRF1_bar24sup_Anterior.gif" border=0 alt="Página anterior"></a><font size=-1>'
				+'&nbsp;</td>'
				+'<td width=1 valign=top><img src=/Layout/trf1_bar24sup_fim.gif></td>'
				+'</tr></table>';
	document.write (layout_barra);
}

function imprime_barra24_inf(){
	layout_barra = '<TABLE BORDER=0 width=100% cellspacing=0 cellpadding=0>'
				+'<tr height=24><td width=1 height=24 valign=top>'
				+'<img src=/Layout/trf1_bar24Inf_inicio.gif></td>'
				+'<td background=/Layout/trf1_bar24Inf.gif valign=top align=right>'
				+'<a href="javascript:history.go(-1)">'
				+'<img src="/Layout/TRF1_bar24Inf_Anterior.gif" border=0 alt="Página anterior"></a>'
				+'&nbsp;</td>'
				+'<td width=1 valign=top><img src=/Layout/trf1_bar24Inf_fim.gif></td>'
				+'</tr></table>';
	document.write (layout_barra);
}

function imprime_barra25_inf(pagina){
	layout_barra = '<TABLE BORDER=0 width=100% cellspacing=0 cellpadding=0>'
				+'<tr height=24><td width=1 height=24 valign=top>'
				+'<img src=/Layout/TRF1_Bar24Inf_Inicio.gif></td>'
				+'<td background=/Layout/trf1_Bar24Inf.gif valign=top align=left>'
				+'<a href="'+pagina+'">'
				+'<img src="/Layout/TRF1_Bar24Inf_Pesquisa.gif" border=0 alt="Página anterior"></a>'
				+'&nbsp;</td>'
				+'<td width=1 valign=top><img src=/Layout/TRF1_Bar24Inf_Fim.gif></td>'
				+'</tr></table>';
	document.write (layout_barra);
}
function imprime_barra25_sup(pagina){
	layout_barra = '<TABLE BORDER=0 width=100% cellspacing=0 cellpadding=0>'
				+'<tr height=24>'
				+'<td width=1 height=24 valign=top>'
				+'<img src=/Layout/TRF1_Bar24Sup_Inicio.gif></td>'
				+'<td background=/Layout/TRF1_Bar24Sup.gif valign=top align=left>'
				+'<a href="'+pagina+'">'
				+'<img src="/Layout/TRF1_Bar24Sup_Pesquisa.gif" border=0 alt="Página anterior"></a><font size=-1>'
				+'&nbsp;</td>'
				+'<td width=1 valign=top><img src=/Layout/TRF1_Bar24Sup_fim.gif></td>'
				+'</tr></table>';
	document.write (layout_barra);
}
function imprime_barra25_inf(pagina){
	layout_barra = '<TABLE BORDER=0 width=100% cellspacing=0 cellpadding=0>'
				+'<tr height=24><td width=1 height=24 valign=top>'
				+'<img src=/Layout/TRF1_Bar24Inf_Inicio.gif></td>'
				+'<td background=/Layout/trf1_Bar24Inf.gif valign=top align=left>'
				+'<a href="'+pagina+'">'
				+'<img src="/Layout/TRF1_Bar24Inf_Pesquisa.gif" border=0 alt="Página anterior"></a>'
				+'&nbsp;</td>'
				+'<td width=1 valign=top><img src=/Layout/TRF1_Bar24Inf_Fim.gif></td>'
				+'</tr></table>';
	document.write (layout_barra);
}
function imprime_barra26_inf(pagina){
	layout_barra = '<TABLE BORDER=0 width=100% cellspacing=0 cellpadding=0>'
				+'<tr height=24><td width=1 height=24 valign=top>'
				+'<img src=/Layout/trf1_bar24Inf_inicio.gif></td>'
				+'<td background=/Layout/trf1_bar24Inf.gif valign=top align=left>'
				+'<a href="'+pagina+'">'
				+'<img src="/Layout/Trf1_Bar26Inf_Pesquisa.gif" border=0 alt="Página anterior"></a>'
				+'&nbsp;</td>'
				+'<td width=1 valign=top><img src=/Layout/trf1_bar24Inf_fim.gif></td>'
				+'</tr></table>';
	document.write (layout_barra);
}
function imprime_barra26_sup(pagina){
	layout_barra = '<TABLE BORDER=0 width=100% cellspacing=0 cellpadding=0>'
				+'<tr height=24>'
				+'<td width=1 height=24 valign=top>'
				+'<img src=/Layout/trf1_bar24sup_inicio.gif></td>'
				+'<td background=/Layout/trf1_bar24sup.gif valign=top align=left>'
				+'<a href="'+pagina+'">'
				+'<img src="/Layout/Trf1_Bar26Sup_Pesquisa.gif" border=0 alt="Página anterior"></a><font size=-1>'
				+'&nbsp;</td>'
				+'<td width=1 valign=top><img src=/Layout/trf1_bar24sup_fim.gif></td>'
				+'</tr></table>';
	document.write (layout_barra);
}
function imprime_barra27_inf(pagina,pgtopic,pglist,tipolista){
	layout_barra = '<TABLE BORDER=0 width=100% cellspacing=0 cellpadding=0>'
				+'<tr height=24><td width=1 height=24 valign=top>'
				+'<img src=/Layout/trf1_bar24Inf_inicio.gif></td>'
				+'<td background=/Layout/trf1_bar24Inf.gif valign=top width=1 align=left>'
				+'<a href="'+pagina+'">'
				+'<img src="/Layout/Trf1_Bar24Inf_Pesquisa.gif" border=0 alt="Nova Pesquisa"></a><font size=-1>'
				+'&nbsp;</td>'
				+'<td background=/Layout/trf1_bar24Inf.gif valign=top width=1 align=left>'
				+'<a href="#A" onclick=\"javascript:MontaTopicos(\''+pgtopic+'\')\">'
				+'<img src="/Layout/Trf1_Bar24Inf_Topico.gif" border=0 alt="Listar Tópicos"></a><font size=-1>'
				+'&nbsp;</td>'
				+( pglist != "" ? ' <td background=/Layout/trf1_bar24Inf.gif valign=top width=1 align=left>'
				+'<a href="'+pglist+'">'
				+'<img ' +( tipolista == "2" ? 'src="/Layout/Trf1_Bar24Inf_Lista.gif" border=0 alt="Lista de Documentos"' : 'src="/Layout/Trf1_Bar24Inf_Documento.gif" border=0 alt="Ver Documentos"') + '>'
				+ '</a><font size=-1>'
				+'&nbsp;</td>' : "" )
				+'<td background=/Layout/trf1_bar24Inf.gif valign=top width=100% align=left>'
				+'<font size=-1>'
				+'<td width=1 valign=top><img src=/Layout/trf1_bar24Inf_fim.gif></td>'
				+'</tr></table>';
	document.write (layout_barra);
}
function imprime_barra27_sup(pagina,pgtopic,pglist,tipolista){
	layout_barra = '<TABLE BORDER=0 width=100% cellspacing=0 cellpadding=0>'
				+'<tr height=24>'
				+'<td width=1 height=24 valign=top>'
				+'<img src=/Layout/trf1_bar24sup_inicio.gif></td>'
				+'<td background=/Layout/trf1_bar24sup.gif valign=top width=1 align=left>'
				+'<a href="'+pagina+'">'
				+'<img src="/Layout/Trf1_Bar24Sup_Pesquisa.gif" border=0 alt="Nova Pesquisa"></a><font size=-1>'
				+'&nbsp;</td>'
				+'<td background=/Layout/trf1_bar24sup.gif valign=top width=1 align=left>'
				+'<a href="#A" onclick=\"javascript:MontaTopicos(\''+pgtopic+'\')\">'
				+'<img src="/Layout/Trf1_Bar24Sup_Topico.gif" border=0 alt="Listar Tópicos"></a><font size=-1>'
				+'&nbsp;</td>'
				+( pglist != "" ? '<td background=/Layout/trf1_bar24sup.gif valign=top width=1 align=left>'
				+'<a href="'+pglist+'">'
				+'<img ' +( tipolista == "2" ? 'src="/Layout/Trf1_Bar24Sup_Lista.gif" border=0 alt="Lista de Documentos"' : 'src="/Layout/Trf1_Bar24Sup_Documento.gif" border=0 alt="Ver Documentos"') + '>'
				+'</a><font size=-1>'
				+'&nbsp;</td>' : "" )
				+'<td background=/Layout/trf1_bar24sup.gif valign=top width=100% align=left>'
				+'<font size=-1>'
				+'&nbsp;</td>'
				+'<td width=1 valign=top><img src=/Layout/trf1_bar24sup_fim.gif></td>'
				+'</tr></table>';
	document.write (layout_barra);
}
function imprime_barra28_sup(pagina){
	layout_barra = '<TABLE BORDER=0 width=100% cellspacing=0 cellpadding=0>'
				+'<tr height=24>'
				+'<td width=1 height=24 valign=top>'
				+'<img src=/Layout/TRF1_Bar24Inf_Inicio.gif></td>'
				+'<td background=/Layout/TRF1_Bar24Sup.gif valign=top align=right>'
				+'<a target=_top href="'+pagina+'">'
				+'<img src="/Layout/TRF1_Bar24Sup_Pesquisa.gif" border=0 alt="Página anterior"></a><font size=-1>'
				+'&nbsp;</td>'
				+'<td width=1 valign=top><img src=/Layout/TRF1_Bar24Sup_fim.gif></td>'
				+'</tr></table>';
	document.write (layout_barra);
}
function imprime_barra28_inf(pagina){
	layout_barra = '<TABLE BORDER=0 width=100% cellspacing=0 cellpadding=0>'
				+'<tr height=24><td width=1 height=24 valign=top>'
				+'<img src="/Layout/TRF1_Bar24Inf_Inicio.gif"></td>'
				+'<td background="/Layout/TRF1_Bar24Inf.gif" valign=top align=right>'
				+'<a target=_top href="'+pagina+'">'
				+'<img src="/Layout/TRF1_Bar24Inf_Pesquisa.gif" border=0 alt="Página anterior"></a>'
				+'&nbsp;</td>'
				+'<td width=1 valign=top><img src="/Layout/TRF1_Bar24Inf_fim.gif"></td>'
				+'</tr></table>';
	document.write (layout_barra);
}
function imprime_barra_info_pdf(){
	var barra_info_pdf;
	barra_info_pdf = '<TABLE border=0 CELLSPACING="0" CELLPADDING="0" width=100%>'
					+ '	<tr><TD  WIDTH=100% BGCOLOR=#033C5F>'
					+ '	<table width="100%" BORDER="1" CELLSPACING="1" CELLPADDING="1">'
            		+ '	<tr WIDTH=100% BGCOLOR=#FFFFFF> '
              		+ '	<td rowspan=2>'
					+ '	<table width=100% border=0><tr><td>'
					+ '	<a href="http://www.adobe.com.br/products/acrobat/readstep2.html" target="_new">'
					+ '	<img border="0" src="/ImagemIcone/trf1_icone_PDF.jpg" width="19" height="19">'
					+ '	</a></td>'
					+ '	<td><font face="Verdana" size=1>'
					+ 'Caso você ainda não possua o <b><i>Adobe Acrobat Reader</i></b>, necessário para ler documentos PDF gerados pelo TRF, clique no ícone ao lado.'
					+ '	</td></tr></table></td>'
					+  '	</tr></table>'
					+ '</td>'
					+ '</tr>'
					+ '</table>';
	document.write (barra_info_pdf);
	

}
function imprime_barra_info_geral1(msg){
	var barra_info_geral;
	msg = "" + msg + "";
	barra_info_geral = '<TABLE border=0 CELLSPACING="0" CELLPADDING="0" align=center width=80%>'
					+ '	<tr><TD  WIDTH=100% BGCOLOR=#033C5F>'
					+ '	<table width="100%" BORDER="1" CELLSPACING="1" CELLPADDING="1">'
            		+ '	<tr WIDTH=100% BGCOLOR=#FFFFFF> '
              		+ '	<td rowspan=2>'
					+ '	<table width=100% border=0><tr><td>'
					+ '	<img border="0" src="/Layout/IconeExclamacao.gif" width="19" height="19">'
					+ '	</td>'
					+ '	<td><font face="Verdana" size=1>'
					+ msg
					+ '	</td></tr></table></td>'
					+  '	</tr></table>'
					+ '</td>'
					+ '</tr>'
					+ '</table>';
	document.write (barra_info_geral);
}
function imprime_barra_info_atencao(msg){
	var barra_info_geral;
	msg = "" + msg + "";
	barra_info_geral = '<TABLE border=1 CELLSPACING="0" CELLPADDING="0" align=center width=80%>'
					+ '	<tr><TD  WIDTH=100% BGCOLOR=#033C5F>'
					+ '	<table width="100%" BORDER="1" CELLSPACING="1" CELLPADDING="1">'
            		+ '	<tr WIDTH=100% BGCOLOR=#FFFFFF> '
              		+ '	<td rowspan=2 nowrap>'
					+ '	<table width=100% border=0><tr><td>'
					+ '	<img border="0" src="/Layout/IconeExclamacaoMaior.gif">'
					+ '	</td>'
					+ '	<td><font face="Verdana" size=1>'
					+ msg
					+ '	</td></tr></table></td>'
					+  '	</tr></table>'
					+ '</td>'
					+ '</tr>'
					+ '</table>';
	document.write (barra_info_geral);
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v;}

hideShowCovered(MM_findObj(args[0]));


}

function AbrirJanelaTamanho(urlu,largura,altura) 
{  
var winopen=open(urlu,"newWindow","height="+altura+",width="+largura+",top=0,left=0,leftmargin=0,topmargin=0,marginwidth=0,marginheight=0,toolbar=1,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,toolbar=0"); 
} 
function AbrirJanelaTamanhoRolagem(urlu,largura,altura) 
{  
var winopen=open(urlu,"newWindow","height="+altura+",width="+largura+",top=0,left=0,leftmargin=0,topmargin=0,marginwidth=0,marginheight=0,toolbar=1,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,toolbar=0"); 
} 
function AbrirJanela(url) 
{  
var winopen=open(url,"newWindow","height="+(screen.availHeight-50)+",width="+(screen.availWidth-10)+",top=0,left=0,toolbar=1,directories=0,status=0,menubar=0,scrollbars=1,resizable=1"); 
} 

function AbrirJanelaLimpa(url) 
{  
var winopen=open(url,"newWindow","height="+(screen.availHeight-150)+",width="+(screen.availWidth-10)+",top=0,left=0,toolbar=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1"); 
}

function AbreSinteseNet()
{
	Propr_Jan = "top=0,left=0,toolbar=yes,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes";

	var ws = screen.availWidth-12;
	var hs = screen.availHeight-50;
	var ts = ",width="+ws+",height="+hs;
	
	var Jan = window.open('/consulta/sintesenet/contador.php','',Propr_Jan+ts);
}


function AbreTC()
{
	Propr_Jan = "top=0,left=0,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no";

	var ws = screen.availWidth-12;
	var hs = screen.availHeight-50;
	var ts = ",width="+ws+",height="+hs;
	
	var Jan = window.open('/Consulta/DocOficial/DocOficialAbrePdf.php?numero=23821','',Propr_Jan+ts);
}


function VerSeENumero(campo)
{
	if (((event.keyCode) >= 48 ) && ((event.keyCode) <= 57 ))
		event.keyCode;				
	else
		event.keyCode = 0;
}
function LimpaNumericoTexto(NumProc)
{ 
	tamanho = NumProc.length; 
	asci =0; 
	NumProc.trim; 
	numeros="0123456789";
	aux="";
	for(i=0;i<tamanho;i++){
		caracatual = NumProc.charAt(i);
		if (numeros.indexOf(caracatual)>-1)
			aux+=caracatual;
	}
	return aux;
}
function LimpaNumericoTextoId(NumProc)
{ 
	objetoHere = document.getElementById(NumProc);
	strObj = objetoHere.value;
	strObj = sobjtrtrim(strObj);
	tamanho= strObj.length;
	asci =0; 
	numeros="0123456789";
	aux="";
	for(i=0;i<tamanho;i++){
		caracatual = objetoHere.value.charAt(i);
		if (numeros.indexOf(caracatual)>-1)
			aux+=caracatual;
	}
	return aux;
}
function limpacampo(campo) {
    vr = campo.value;
    vr = vr.replace( "/", "" );
    vr = vr.replace( "/", "" );
    vr = vr.replace( ",", "" );
    vr = vr.replace( ".", "" );
    vr = vr.replace( ".", "" );
    vr = vr.replace( ".", "" );
    vr = vr.replace( ".", "" );
    vr = vr.replace( "-", "" );
	if (vr.substr( 0,1)=='0') vr=vr.substr( 1,100)
	if (vr.substr( 0,1)=='0') vr=vr.substr( 1,100)
	if (vr.substr( 0,1)=='0') vr=vr.substr( 1,100)
	if (vr.substr( 0,1)=='0') vr=vr.substr( 1,100)
    campo.value=vr;
}
function sobjtrtrim(obj) {
	return obj.replace(/^\s+/,'').replace(/\s+$/,'');
}

function desformataData(valor)
{
	var valorNaoFormatado=valor;
	var aValidas="0123456789";
	var temp="";
	var car=-1;
	for (i=0;i<valorNaoFormatado.length;i++)
	{
		car=valorNaoFormatado.charAt(i)
		if (aValidas.indexOf(car)!= -1) temp=temp + car;
	}
	return(temp);
}

function formatadata(campo) {
	vr = campo.value;
	vr = desformataData(vr);
  	
	n1=vr.substr( 0,1);
	n2=vr.substr( 1,1);
	n3=vr.substr( 2,1);
	n4=vr.substr( 3,1);
	n5=vr.substr( 4,1);
	n6=vr.substr( 5,1);
	n7=vr.substr( 6,1);
	n8=vr.substr( 7,1);
	tam = vr.length;
	//alert(vr+'-'+tam)
	if ( tam == 4 ){
	     campo.value = '0'+n1+'/0'+n2+'/'+n3+n4; }
	if ( tam == 5 ){
	     campo.value = '0'+n1+'/'+n2+n3+'/'+n4+n5; }
	if ( tam == 6 ){
	     campo.value = n1+n2+'/'+n3+n4+'/'+n5+n6; }
	if ( tam >= 7 ){
	     campo.value = n1+n2+'/'+n3+n4+'/'+n5+n6+n7+n8; }
}

function TestaData(valor)
{
	if (valor.length==0){
		return true;
		}
	else 
	{
		if (valor.length==10)
		{
			var sd = valor.split("/");
		    sd[2] = (sd[2] < 1000) ? sd[2] + 1900 : sd[2];
		    sd[1]--;
		    var test = new Date(sd[2],sd[1],sd[0]);
			var dia = test.getDate();
			var mes = test.getMonth();
			var ano = test.getYear();
			ano = (ano < 1000) ? ano + 1900 : ano;
		    if ( (ano == sd[2]) && (sd[1] == mes) && (sd[0] == dia) ){
				return true;
			}
			else
			{
				return false;
			}
		}
		else 
		{
			return false;
		}
	}				
	return true;
}


function AbreTipoDocumento(JNL)
{	
	var PosInicial;
	var PosFinal;
	var Imagem = false;
	if(JNL.lastIndexOf('.')!=-1){
		JNL = JNL.toLowerCase();
		PosInicial = JNL.lastIndexOf('.')+1;
		if(JNL.indexOf('?')!=-1){
			PosFinal = JNL.indexOf('?');
		}
		else{
			PosFinal = JNL.length;
		}
		tipo = JNL.substring(PosInicial,PosFinal);
		if(tipo=='pdf')
			Propr_Jan = "top=0,left=0,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
		else if((tipo=='htm')||(tipo=='html')||(tipo=='asp')||(tipo=='php')||(tipo=='jsp'))
			Propr_Jan = "top=0,left=0,toolbar=yes,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
		else if(tipo=='doc')
			Propr_Jan = "top=0,left=0,toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes";
		else if((tipo=='gif')||(tipo=='jpg')||(tipo=='bmp')||(tipo=='tif')){
			Propr_Jan = "top=0,left=0,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
			Imagem = true;
		}
		else{
			Propr_Jan = "top=0,left=0,toolbar=yes,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
			}
	}
	else{
		Propr_Jan = "top=0,left=0,toolbar=yes,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
	}
	var ws = screen.availWidth-12;
	var hs = screen.availHeight-50;
	
	var wsimg = screen.availWidth-180;
	var hsimg = screen.availHeight-180;
	
	var ts = ",width="+ws+",height="+hs;
	if(Imagem){
		var Jan = window.open('','',Propr_Jan+ts);
		Jan.document.write("<html>\n");
		Jan.document.write("<head>\n");
		Jan.document.write("<title>Tribunal Regional Federal</title>");
		Jan.document.write("</head>\n");
		Jan.document.write("<body>\n");
		Jan.document.write("<table border=0 align=center width=1 heigth=1><tr><td><a href=\"#\" onclick=\"javascript:window.close()\"><img alt=\"Clique na foto para fechar\" width=\""+wsimg+"px\" src=\""+ JNL +"\" vspace=0 border=0></a></td></tr></table>\n");
	 	Jan.document.write("</body>");
	}
	else{
		var Jan = window.open(JNL,'',Propr_Jan+ts);
	}
	var w = screen.availWidth||screen.width; 
	var h = screen.availHeight||screen.height; 
	//Jan.moveTo(0,0);
	//Jan.resizeTo(w,h);
}
function AbreItemDocumento(JNL)
{	
	var PosInicial;
	var PosFinal;
	var Imagem = false;
	if(JNL.lastIndexOf('.')!=-1){
		PosInicial = JNL.lastIndexOf('.')+1;
		if(JNL.indexOf('?')!=-1){
			PosFinal = JNL.indexOf('?');
		}
		else{
			PosFinal = JNL.length;
		}
		tipo = JNL.substring(PosInicial,PosFinal);
		if(tipo=='pdf')
			Propr_Jan = "top=0,left=0,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
		else if((tipo=='htm')||(tipo=='html')||(tipo=='asp')||(tipo=='php')||(tipo=='jsp'))
			Propr_Jan = "top=0,left=0,toolbar=yes,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
		else if(tipo=='doc')
			Propr_Jan = "top=0,left=0,toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes";
		else if((tipo=='gif')||(tipo=='jpg')||(tipo=='bmp')||(tipo=='tif')){
			Propr_Jan = "top=0,left=0,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
			Imagem = true;
		}
		else{
			Propr_Jan = "top=0,left=0,toolbar=yes,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
			}
	}
	else{
		Propr_Jan = "top=0,left=0,toolbar=yes,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
	}
	var ws = screen.availWidth-12;
	var hs = screen.availHeight-50;
	
	var ts = ",width="+ws+",height="+hs;
	var Jan = window.open(JNL,'',Propr_Jan+ts);
}


// --> 

//+'.menuprincipal:hover {  font-family: Verdana, Arial; font-size: 10px; font-style: normal; color: #FFFFFF; text-decoration: none;background-color: #990000; height: 12px; width: 140px}'

/*
document.write ('<style type="text/css">'
+'<!--'
+'.menuprincipal      {  font-family: Verdana, Arial; font-size: 10px; font-style: normal; line-height: normal; text-decoration: none; color: #FFFFFF;height: 12px; width: 140px}'
+'.menuprincipal:hover { font-family: Verdana, Arial; font-size: 10px; color: #FFFFFF; background-color: #990000; height: 12px}'
+'.amenuprincipal:link {  font-family: Verdana, Arial; font-size: 10px; font-style: normal; line-height: normal; text-decoration: none; color: #FFFFFF; height: 12px; width: 140px}'
+'.titulo1 {font-family: Verdana, Arial; font-size: 16px; color: #663333; font-weight: bolder;}'
+'.titulo2 {font-family: Verdana, Arial; font-size: 14px; color: #663333; font-weight: bold;}'
+'.titulo3 {font-family: Verdana, Arial; font-size: 11px; color: #663333; font-weight: bold;}'
+'.menu2 {COLOR: #666666; TEXT-DECORATION: none}'
+'.menu2:hover {BACKGROUND: #FFFFFF; COLOR: #663333; TEXT-DECORATION: none}'
+'.Pmenu {Font-family: Verdana, Arial ;Font-size: 12px;Color: #663333;line-height: 10px;cursor: hand;line-height: 12px;padding-top: 9px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;height: 0px;margin: 1px;background-color: #EFEBEF;vertical-align: middle;}'
+'.Pmenu:hover {Font-family: Verdana, Arial;Font-size: 11px;Color: #663333;line-height: 1px;cursor: hand;background-color: #CC0000;}'
+'.linktabela {COLOR: #000000; TEXT-DECORATION: none}'
+'.linktabela:hover {COLOR: red; TEXT-DECORATION: none}'
+'.bordatabela {BACKGROUND: #663333; COLOR: #663333; }'
+'.textotabela {font-family: Verdana, Arial; COLOR: #000000;Font-size: 14px;}'
+'a {Font-family: Verdana, Arial ;font-size=12px; Color: #000000;text-decoration: none}'
+'a:hover {Font-family: Verdana, Arial ;font-size=12px; Color: #A66A6A}'
+'.lista {font-size: 10pt; line-height: 1.0}'
+'.lista1 {font-size: 10pt; line-height: 1.0}'
+'.font1 {font-family: Verdana; font-size: 7pt; line-height: 1.2}'
+'.font2 {font-family: Verdana; font-size: 9pt; line-height: 1.2}'
+'.menua {Font-family: Verdana, Arial ;Font-size: 12px;Color: #000000;text-decoration: underline;height: 10px}'
+'.menua:hover {Font-family: Verdana, Arial;Font-size: 12px;Color: #A66A6A;text-decoration: underline;height: 10px}'
+'a.menu_1:link {  font-family: Verdana, Arial; font-size: 12px; color: #A88A8A; font-weight: bold; text-decoration:none}'
+'a.menu_1:active {  font-family: Verdana, Arial; font-size: 12px; color: #A88A8A; font-weight: bold; text-decoration:none}'
+'a.menu_1:visited {  font-family: Verdana, Arial; font-size: 12px; color: #A88A8A; font-weight: bold; text-decoration:none}'
+'a.menu_1:hover {  font-family: Verdana, Arial; font-size: 12px; color: #663333; font-weight: bold; text-decoration:none}'

+'-->'
+'</style>');

*/
function autenticacao(autenticacao,grupo)  
{  
 //Esta função chama uma pequena tela para autenticação do usuario   
altura= ((screen.width) - 300) /2 ;
largura=((screen.height) - 250) /2 ; 			
window.open('/Objetos/Autenticacao.php?tela=ok&autenticacao='+autenticacao+'&grupo='+grupo+'','','top='+largura+',left='+ altura +',width=360,height=250,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
} 
function PrintMapa()
{
	/* Imprime o frame principal */  
	window.parent.mainFrame.focus();
	window.print();

}
function BarraSetorialRodape()
{ 
	/*Imprime a barra do rodapé de todas as páginas setoriais do estilo novo*/
	document.write('<img src="/ImagemLayout2/trf1_menu_inferior_setorial.gif" name="TRF1_Menu_Inferior" width="111" height="22" border="0" usemap="#m_TRF1_Menu_Inferior">');
	
	document.write('<map name="m_TRF1_Menu_Inferior">'
				+'<area shape="rect" coords="34,2,54,20" alt="Página Inicial" href="Default.htm" target=_top >'
				+'<area shape="rect" coords="59,4,80,20" alt="Fale Conosco" href="Contato.php" target="mainFrame">'
				+'<area shape="rect" coords="84,3,104,20" alt="Imprimir Conteúdo" href="javascript:PrintMapa();"></map>'); 
}

function CabecalhoSetorial()
{ 
	if ((location.host=='extranet.trf1.gov.br')||(location.host=='extranet'))
	{
	document.write('<a href="/" target="_top" ><img src="/Layout/CabecalhoExtranet.gif" border=0></a>')	
	}
	else 
	{ 
		if((location.host=='intranet.trf1.gov.br')||(location.host=='intranet'))
		{
		document.write('<a href="/" target="_top" ><img src="/Layout/CabecalhoIntranet.gif"  border=0 ></a>')
		}
		else
		{
			if ((location.host=='wwwdsv')||(location.host=='servweb3-trf1')||(location.host=='wwwdsv.trf1.gov.br'))
			{
			document.write('<a href="/" target="_top" ><img src="/Layout/CabecalhoDesenvolvimento.gif"  border=0 ></a>')	
			}
			else
			{
			document.write('<a href="/" target="_top" ><img src="/Layout/Cabecalho.gif"  border=0 ></a>')	
			}
		}
	}

}

function AbreClipping()
{



Propr_Jan = "top=0,left=0,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no";

	var ws = screen.availWidth-12;
	var hs = screen.availHeight-50;
	var ts = ",width="+ws+",height="+hs;
	
	var Jan = window.open('http://trf1.empauta.com/trf1/index.php','',Propr_Jan+ts);
}


function AbreCardapio()
{
Propr_Jan = "top=0,left=0,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no";

	var ws = screen.availWidth-12;
	var hs = screen.availHeight-50;
	var ts = ",width="+ws+",height="+hs;
	
	var Jan = window.open('/Setorial/PGQVT/CardapioRestaurante/Arquivo/Cardapio.pdf','',Propr_Jan+ts);
}


//funcoes para esconder os combos que sobressaem o menu

function getAbsolutePos(el) {
	var SL = 0, ST = 0;
	var is_div = /^div$/i.test(el.tagName);
	if (is_div && el.scrollLeft)
		SL = el.scrollLeft;
	if (is_div && el.scrollTop)
		ST = el.scrollTop;
	var r = { x: el.offsetLeft - SL, y: el.offsetTop - ST };
	if (el.offsetParent) {
		var tmp = this.getAbsolutePos(el.offsetParent);
		r.x += tmp.x;
		r.y += tmp.y;
	}
	return r;
};
function hideShowCovered(el) {
	function getVisib(obj){
		var value = obj.style.visibility;
		if (!value) {
			if (window.document.defaultView && typeof (window.document.defaultView.getComputedStyle) == "function") { // Gecko, W3C
				var is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
				if (!is_khtml)
					value = window.document.defaultView.
						getComputedStyle(obj, "").getPropertyValue("visibility");
				else
					value = '';
			} else if (obj.currentStyle) { // IE
				value = obj.currentStyle.visibility;
			} else
				value = '';
		}
		return value;
	};

	var tags = ["applet", "iframe", "select"];
	
	var p = getAbsolutePos(el);
	var EX1 = p.x;
	var EX2 = el.offsetWidth + EX1;
	var EY1 = p.y;
	var EY2 = el.offsetHeight + EY1;

	for (var k = tags.length; k > 0; ) {
		//var ar = window.document.getElementsByTagName(tags[--k]);
	 	var ar = getObjeto(tags[--k]);
		var cc = null;
		
		for (var i = ar.length; i > 0;) {
			cc = ar[--i];
			
			p = getAbsolutePos(cc);
			var CX1 = p.x;
			var CX2 = cc.offsetWidth + CX1;
			var CY1 = p.y;
			var CY2 = cc.offsetHeight + CY1;
			
			if ((el.style.visibility=="hidden") || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
				if (!cc.__msh_save_visibility) {
					cc.__msh_save_visibility = getVisib(cc);
				}
				cc.style.visibility = cc.__msh_save_visibility;
			} else {
				if (!cc.__msh_save_visibility) {
					cc.__msh_save_visibility = getVisib(cc);
				}
				cc.style.visibility = "hidden";
			}
		}
	}
}

function getObjeto(tagName){
	var objeto;
	var indice = parent.frames.length;
	for(var i=0; i<indice; i++){
		objeto = parent.frames[i].document.getElementsByTagName(tagName);
		if(objeto.length > 0){
			return objeto;
		}
	}
	return objeto;
}
