<script language="JavaScript" type="text/javascript">
<!--

function anySelected()
{
    for (i = 0; i < document.list.elements.length; i++) {
        if (document.list.elements[i].checked) return true;
    }
    return false;
}

function chooseAction(whichForm)
{
    if (!anySelected()) {
        window.alert('<?php echo addslashes(_("You must select at least one meeting first.")) ?>');
    } else {
        if (whichForm == 1) {
            document.list.actionID.value = document.list.action1.options[document.list.action1.selectedIndex].value;
        } else {
            document.list.actionID.value = document.list.action2.options[document.list.action2.selectedIndex].value;
        }
        
        if (document.list.actionID.value == <?php echo MOMENT_DELETE_MEETING ?>) {
            if (!window.confirm('<?php echo addslashes(_("Are you sure you want to permanently delete these meetings?")) ?>')) {
                return false;
            }
        }

        document.list.submit();
    }
}

//-->
</script>
