/**
 * Check all the checkboxes on the givin form
 */
function checkAll(form)  {

    for (i = 0; i < form.elements.length; i++)  {
        if (form.elements[i].type == "checkbox") {
            form.elements[i].checked = true;
        }
    }

}

/**
 * Uncheck all the checkboxes on the given form
 */
function uncheckAll(form)  {

    for (i = 0; i < form.elements.length; i++)  {
        if (form.elements[i].type == "checkbox") {
            form.elements[i].checked = false;
        }
    }

}

/**
 * The user may not select the first option ("Select ...")
 */
function validateBrowse(id)  {

    var select = document.getElementById(id);

    if (select.options[select.selectedIndex].value <= 0)  {
        alert("Please select a resource from the drop-down box.");
        return false;
    } else  {
        return true;
    }

}