function showHide(id){
    if ($("div#" + id).css("display") == 'none') {
        $("div#" + id).slideDown("slow");
    }
    else {
        $("div#" + id).slideUp("slow");
    }
}

/* FUNÇÕES PARA PAINEL VOIP */
function doPostBack(eventTarget, eventArgument){
    var theForm = document.getElementById('historico');
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.pagina.value = eventTarget;
        theForm.submit();
    }
}

function selecionar_tudo(){
    for (i = 0; i < document.f1.elements.length; i++) 
        if (document.f1.elements[i].type == "checkbox") 
            document.f1.elements[i].checked = 1
}

function deselecionar_tudo(){
    for (i = 0; i < document.f1.elements.length; i++) 
        if (document.f1.elements[i].type == "checkbox") 
            document.f1.elements[i].checked = 0
}

function select_unselect(){
    if (document.getElementById('selecionar_todos').checked) {
        selecionar_tudo();
    }
    else {
        deselecionar_tudo();
    }
}