function setIframeHeight(iframeName) {
  var iframeWin = window.frames[iframeName];
  var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
  if ( iframeEl && iframeWin ) {
    iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous  
    var docHt = getDocHeight(iframeWin.document);
    // need to add to height to be sure it will all show
    if (docHt) iframeEl.style.height = docHt + 30 + "px";
  }
}

function loadIframe(iframeName, url) {
  if ( window.frames[iframeName] ) {
    window.frames[iframeName].location = url;   
    return false;
  }
  else return true;
}

function PrintMapa(){
		window.parent.corpo.focus();
		window.print();
}

function PrintMapaHome(){
		window.parent.focus();
		window.print();
}


function imprime_barra_titulo(){
	layout_barra = '<center><table cellpadding=0 cellspacing=0 width=100%><tr><td nowrap><img src=/images/barra_inicio.gif height=10 width=4><img src=/images/barra_titulo.gif height=10 width=99%><img src=/images/barra_fim.gif height=10 width=4></td></tr></table></center>';
	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_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 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 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 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>'); 
}

