﻿function toggleCheck(partialId, checked) {
    for (i = 0; i < document.forms[0].elements.length; i++) {
        elm = document.forms[0].elements[i]

        if (elm.type == 'checkbox') {

            if (elm.id.indexOf(partialId) > 0) {

                elm.checked = checked;

            }

        }

    }
}


function checkAll(partialId) {
    toggleCheck(partialId, true);
}

function uncheckAll(partialId) {
    toggleCheck(partialId, false);
}
