//
function doSearchGroup(action) {
    //
    var form = document.input;
    if (form == null) {
        return;
    }
        //
    var category = form.category;
    if (category) {
        var category_name = form.category_name;

        if (category.selectedIndex > 0) {
            category_name.value = category[category.selectedIndex].text;
        }
    }

    //
    form.operation.value = "search";
    //
    for (var i = 0; i < form.assigned_group.length; i++) {
        form.assigned_group.item(i).selected = true;
    }
    //
    form.elements[action].value = "true";
    //
    form.submit();
}

function doAssignGroup(action, group_list, message) {
    //
    var form = document.input;
    if (form == null) {
        return;
    }
    //
    if (action == 'action_user_assignGroup' || action == 'action_resource_assignGroup') {
        //
        if (!confirm(
            message + "\n"
            + "よろしいですか？")) {
            return;
        }
    } else if (action == 'action_user_deassignGroup' || action == 'action_resource_deassignGroup') {
        if (!confirm(
            message + "\n"
            + "よろしいですか？")) {
            return;
        }
    }
    //
    form.operation.value = "update";
    //
    for (var i = 0; i < form.elements[group_list].length; i++) {
        form.elements[group_list].item(i).selected = true;
    }
    //
    form.elements[action].value = "true";
    //
    form.submit();
}
