// * Funcao que verifica se existe bloqueador de popup
function checaBloqueador()
{
    var testeFull = window.open('login.php','ConvWeb','width=800,height=600,top=0,left=0,status=1,resizable=1,scrollbars=1');
    if (testeFull){
        return false;
    } else {
        return true;
    }
}


function RetornoChecaBloqueador()
{
    if (bloqueador){
        alert('Foi detectado um bloqueador de pop-up em seu navegador.\n\nPara usar o sistema é necessário que você o desabilite, ao menos para o domínio atual.');
        document.getElementById("txtVerificacaoBloqueado").style.display = "block";
        return false;
    } else {
        document.getElementById("txtVerificacao").style.display = "block";
    }
}


function AbrirJanela()
{
    var janela = window.open('login.php','ConvWeb','width=800,height=600,top=0,left=0,status=1,resizable=1,scrollbars=1');
}


// * Alinha o tamanho da janela a resolução da tela - login
window.moveTo(0,0);
if (document.all) {
    top.window.resizeTo(screen.availWidth,screen.availHeight);
} else if (document.layers||document.getElementById) {
    if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth) {
        top.window.outerHeight = screen.availHeight;
        top.window.outerWidth = screen.availWidth;
    }
}


// ############################################################
// * Validacao do login
// ############################################################
function ValidaLogin()
{
    f = document.forms[0];

    if (f.login.value == "") {
        alert('Digite a sua IDENTIFICAÇÃO/Nº CARTÃO!!!');
        f.login.focus();
        return false;
    }
    if (f.senha.value == "") {
        alert('Digite a sua SENHA!!!');
        f.senha.focus();
        return false;
    }

    f.btnAcao.value = "entrar";
    f.submit();
}

