$(document).ready(function() {
    $('.popper-info').popover({
        placement: 'top',
        title: 'Informa&ccedil;&otilde;es do Sistema',
        container: '#footer_popover',
        html: true,
        content: function () {
            return $(this).next().html();
        }
      });
    $('.popper-ajuda').popover({
        placement: 'top',
        title: 'Ajuda !',
        container: '#footer_popover',
        html: true,
        content: function () {
            return $(this).next().html();
        }
      });
    $('#main-menu').smartmenus({
        subMenusSubOffsetX: 1,
        subMenusSubOffsetY: -8,
        hideDuration: 0,
        showDuration: 0
    });
    $('#main-menu').smartmenus('keyboardSetHotkey', 123, 'shiftKey');

    // Workaround temporario para eliminar o reticencia (...) da topo
    $('ul.navbar-nav').find('a.dropdown-toggle').find('span.sub-arrow').remove();

    // Encontra todos os botoes de submit dentro de um div.boxBotoes
    // e faz um bind no evento click de cada botao para apagar
    // quaisquer mensagens de erro ativas.
    $("div.boxBotoes").find("input[type=submit]").on("click", function(){
        if ($("div.mensagem").length == 1) {
            $("div.mensagem").html("");
        }
    });
 });
