function FocoInicial(nCampo){
    /* define o focus no primeiro elemento */
    document.getElementById(nCampo).focus();
}
/*
 *      Alerta de exclusão de itens
 */
function Deletar(NOME, OQUE){
    return confirm("Tem certeza que deseja apagar " + OQUE + " " + NOME + "?");
}
function VerNoticiaSite( oque ){
    $('#BasePopup').hide();
    $('#ConteudoPopup').hide();
    $('#BasePopupBloqueia').hide();
    $.post('SUPORTE/processos/VerNoticiaSite.php',{Busca: oque},function(data){
            $('#BasePopup').show();
            $('#ConteudoPopup').show();
            $('#BasePopupBloqueia').show();
            $('#ConteudoPopup').empty().html(data);
        }
    );
}
function VerNoticia( oque ){
    $('#BasePopup').hide();
    $('#ConteudoPopup').hide();
    $('#BasePopupBloqueia').hide();
    $.post('VerNoticia.php',{Busca: oque},function(data){
            $('#BasePopup').show();
            $('#ConteudoPopup').show();
            $('#BasePopupBloqueia').show();
            $('#ConteudoPopup').empty().html(data);
        }
    );
}
function FechaPopup(){
    $('#ConteudoPopup').empty();
    $('#BasePopup').hide();
    $('#ConteudoPopup').hide();
    $('#BasePopupBloqueia').hide();
}

function AddImagens( Qual , Largura , Altura ){
var ConteudoVelho = document.getElementById("Editor").contentWindow.document.body.innerHTML;
    var NovaImagem = "<img alt='' _cke_saved_src='http://www.advocaciavieceli.com.br/SUPORTE/arquivos/"+ Qual +"' src='http://www.advocaciavieceli.com.br/SUPORTE/arquivos/"+ Qual +"' style='width: "+ Largura +"px; height: "+ Altura +"px;'>";
    document.getElementById("Editor").contentWindow.document.body.innerHTML = NovaImagem + ConteudoVelho;
}

function Conteudo(qual){
            $('#DivCorpo').hide();
    $.post(qual+'.php',{},function(data){
            $('#DivCorpo').show();
            $('#DivCorpo').empty().html(data);
        }
    );
}

function ResumoNoticias(oque, qualPag){
    $('#Carregador').hide();
    $('#Carregador').ajaxStart(function(){
            $('#divGeraRelatorio').hide();
            $('#Carregador').show();
    });
    $('#Carregador').ajaxStop(function(){
            $('#Carregador').hide();
    });
    $.post('ResumoNoticias.php',{Busca: oque , NumPag: qualPag},function(data){
            $('#divGeraRelatorio').show();
            $('#divGeraRelatorio').empty().html(data);
        }
    );
}
function EditarNoticia(nNome , oCod , aAba){
    if (nNome == "Atualizar"){
    document.getElementById('celAbaCadastro').innerHTML = "Editar Not&iacute;cia";
    trataCliqueAba('celAbaCadastro');
    $('#Carregador').hide();
    $('#Carregador').ajaxStart(function(){
            $('#divGeraCadastro').hide();
            $('#Carregador').show();
    });
    $('#Carregador').ajaxStop(function(){
            $('#Carregador').hide();
    });
    $.post('EditarNoticia.php',{Busca: oCod},function(data){
            $('#divGeraCadastro').show();
            $('#divGeraCadastro').empty().html(data);
        }
    );
    } else {
    document.getElementById('celAbaCadastro').innerHTML = "Nova Not&iacute;cia";
    trataCliqueAba( aAba );
    $('#Carregador').hide();
    $('#Carregador').ajaxStart(function(){
            $('#divGeraRelatorio').hide();
            $('#divGeraCadastro').hide();
            $('#Carregador').show();
    });
    $('#Carregador').ajaxStop(function(){
            $('#Carregador').hide();
    });
    $.post('NovaNoticia.php',{},function(data){
            $('#divGeraCadastro').show();
            $('#divGeraCadastro').empty().html(data);
        }
    );
    $.post('ResumoNoticias.php',{Busca: '' , NumPag: '1'},function(data){
            $('#divGeraRelatorio').show();
            $('#divGeraRelatorio').empty().html(data);
        }
    );
    }
}
function ResumoEmails(oque, qualPag){
    $('#Carregador').hide();
    $('#Carregador').ajaxStart(function(){
            $('#divGeraRelatorio').hide();
            $('#Carregador').show();
    });
    $('#Carregador').ajaxStop(function(){
            $('#Carregador').hide();
    });
    $.post('ResumoEmails.php',{Busca: oque , NumPag: qualPag},function(data){
            $('#divGeraRelatorio').show();
            $('#divGeraRelatorio').empty().html(data);
        }
    );
}
