// Javascript from Moodle modules
/**
 * JavaScript for checking or unchecking 
 * all the students or all students in a group.
 *
 * @param toggle Check All/None
 * @param start the first checkbox to be changed
 * @param end the last checkbox to be changed
 * return boolean
 **/
function block_quickmaileps_toggle(toggle, start, end, mails) {
    // Element ID
    var id = mails+start;

    // iterate through all of the appropriate checkboxes and change their state
    while(document.getElementById(id) && start != end) {
        document.getElementById(id).checked = toggle;
        start++;
        id = mails+start;
    }

    return false;
}

/**
 * JavaScript para alterar entre mostrar lista de usuarios 
 * ou mostrar seleção para arquivo.
 **/
function troca_para() {
    if (document.getElementById('comlista').checked){
	  document.getElementById('tabela').style.display = 'none';
	  document.getElementById('arquivolista').style.display = 'block';
    }
    else{
	  document.getElementById('tabela').style.display = 'block';
	  document.getElementById('arquivolista').style.display = 'none';
    }
}
