﻿function CheckBoxListSelect(cbControl, state) {
    var chkBoxList = $get(cbControl);
    var chkBoxCount = chkBoxList.getElementsByTagName("input");
    for (var i = 0; i < chkBoxCount.length; i++) {
        chkBoxCount[i].checked = state;
    }

    return false;
}

function CheckBoxListItemsSelect(cbControl, state, indicies) {
    var chkBoxList = $get(cbControl);
    var chkBoxCount = chkBoxList.getElementsByTagName("input");
    for (var i = 0; i < indicies.length; i++) {
        var index = indicies[i];
        chkBoxCount[index].checked = state;
    }

    return false;
}

function ShowDialog(dialogId) {
    var dialog = $find(dialogId);
    if (dialog != null) {
        dialog.show();
    }
}

function HideDialog(dialogId) {
    var dialog = $find(dialogId);
    if (dialog != null) {
        dialog.hide();
    }
}

function CheckOption(optId) {
    var opt = $get(optId);
    if (opt != null) {
        opt.checked = true;
    }
}