function toggle(source)
{
    checkboxes = document.getElementsByTagName('input');

    for (var i = 0; i < checkboxes.length; i++) {
        checkboxes[i].checked = source.checked;
    }
}

function deleteRow(tableID, module, folder, campo)
{
    if (folder.length > 0) module = '/' + module;
    if (typeof(campo) === 'undefined') campo = 'marcar';

    if ($('input[name="'+campo+'[]"]:checked').length > 0 === true) {
        if (confirm('Tem certeza que deseja deletar?')) {
            var checkedValues = $('input[name="'+campo+'[]"]:checked').map(function() {
                return this.value;
            }).get();

            window.location.href = folder + module + "/processo.php?t=deletar&id=" + checkedValues.join(",");
        }
    }
}
