/**
 * Checks/unchecks all objects
 *
 * @param   string   the form name
 * @param   boolean  whether to check or to uncheck the element
 *                  
 * @return  boolean  always true
 */
function setCheckboxes(the_form, do_check) {
    var elts = document.forms[the_form].elements['id[]'];
    var elts_cnt  = (typeof(elts.length) != 'undefined')
                  ? elts.length
                  : 0;

    if (elts_cnt) {
    	if (elts[0].checked == do_check) do_check=!do_check;
        for (var i = 0; i < elts_cnt; i++) {
            elts[i].checked = do_check;
        } // end for
    } else {
        elts.checked        = do_check;
    } // end if... else

    return true;
} // end of the 'setCheckboxes()' function

/* Подтвердить удаление */
function confirmLink(theLink, confirmMsg, hrefadd)
{
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm(confirmMsg);
    if (is_confirmed) {
        theLink.href += hrefadd; // добавляем подтверждение удаления
    }

    return is_confirmed;
} // end of the 'confirmLink()' function /* */

