$(document).ready(function(){
    $('.navPrimeiroNivel').click(function(){
        $(this).next('UL').toggleClass('aberto');
        $('.aberto').slideUp('slow');
        $('.aberto').removeClass('aberto');
        $(this).next('UL').slideToggle('slow');
        $(this).next('UL').toggleClass('aberto');
     });
     $('.navPrimeiroNivel').focus(function(){
        $(this).next('UL').toggleClass('aberto');
        $('.aberto').slideUp(1);
        $('.aberto').removeClass('aberto');
        $(this).next('UL').slideToggle(1);
        $(this).next('UL').toggleClass('aberto');
     });
    $('#aumenta_fonte').click(function(){
        $('body, body *').css('font-size','13px');
     });
    $('#reduz_fonte').click(function(){
        $('body, body *').css('font-size','11px');
     });
    $('#contraste').click(function(){
        $('body').toggleClass('contrastado');
     });
    $('.principalMenuCorrespondentes A').click(function(){
        $(this).next('UL').toggleClass('aberto');
        $('.aberto').slideUp('slow');
        $('.aberto').removeClass('aberto');
        $(this).next('UL').slideToggle('slow');
        $(this).next('UL').toggleClass('aberto');
     });
     $('#aponsentado').focus(function(){
        $(this).next('UL').show();
     });
     $('#ultimoFilhoAponsentado').blur(function(){
        $('.menuFlutuante').hide();
     });
     $('#servidorPublico').focus(function(){
        $(this).next('UL').show();
     });
     $('#ultimoFilhoServidorPublico').blur(function(){
        $('.menuFlutuante').hide();
     });
    $('#empresasPrivadas').focus(function(){
        $(this).next('UL').show();
     });
     $('#ultimoFilhoEmpresasPrivadas').blur(function(){
        $('.menuFlutuante').hide();
     });
 });

function abrirP(URL) {
  var width = 500;
  var height = 425;
  var left = 99;
  var top = 99;
  window.open(URL,'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}
function abrirG(URL) {
  var width = 790;
  var height = 425;
  var left = 99;
  var top = 99;
  window.open(URL,'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}
function abrirSCR(URL) {
  var width = 500;
  var height = 600;
  var left = 99;
  var top = 99;
  window.open(URL,'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}
 
function mostraMenuComoUsar(){
    $('.menuComoUsar',parent.conteudo.document).show();
}
var fechar = 0;
function paraTimerMenuComoUsar(){
    window.clearTimeout(fechar);
}
function timerMenuComoUsar() {
    fechar = window.setTimeout(fechaMenuComoUsar, 100);
}
function fechaMenuComoUsar(){
    $('.menuComoUsar').hide();
}
function abreLink(url){
    window.open(url);
}
function ReloadTop()
{ 
	try{parent.frames[0].frames.document.FormIB2001.AGN.focus();}
	catch(e){}
}