function SelecionarTodos(spanChk)
{
    var oItem = spanChk.children;
    var theBox= (spanChk.type=="checkbox") ? 
    spanChk : spanChk.children.item[0];
    xState=theBox.checked;
    elm=theBox.form.elements;
    
    for(i=0;i<elm.length;i++)
        if(elm[i].type=="checkbox" && elm[i].id!=theBox.id)
        {
            if(elm[i].checked!=xState)
                elm[i].click();
        }
}

function ConfirmaExclusao()
{
    return confirm('Deseja realmente excluir este registro?');
}

function AbrirPesquisa(RecebeId, RecebeDescricao, SQL)
{
    window.open('pesquisa.aspx?recebeId='+ RecebeId +'&recebeDescricao='+ RecebeDescricao +'&sql='+ SQL +'', 'Pesquisa', 'menubar=no,scrollbars=yes,statusbar=yes,width=410,height=500');
}

function SomenteNumeroInteiro(e) {
    if (window.event) { //IE
        tecla = e.keyCode;
    }
    else if (e.which) { //FF
        tecla = e.which;
    }
    if ((tecla >= 48 && tecla <= 57) || (tecla == 8)) {
        return true;
    }
    else {
        return false;
    }
}

function SomenteNumeroDecimal(e) {
    if (window.event) { //IE
        tecla = e.keyCode;
    }
    else if (e.which) { //FF
        tecla = e.which;
    }
    if ((tecla >= 48 && tecla <= 57) || (tecla == 8) || (tecla == 44)) {
        return true;
    }
    else {
        return false;
    }
}


