function fakeCheckboxClick(chckbx, popupSuff) {
    var re = new RegExp('^chkbx(.*)_(\\d+)$', 'i');
    var arr;

    if (re.test(chckbx.id)) {
        arr = re.exec(chckbx.id);
        if (arr && (typeof(arr) != 'undefined') && arr[2] && (typeof(arr[2]) != 'undefined')) {
            var inp = $('sbOrder' + popupSuff + '_' + arr[2]);
            if (inp && (typeof(inp) != 'undefined')) {
                if (chckbx.className == 'fake_checkbox') {
                    chckbx.className = 'fake_checkbox_selected';
                    inp.value = 1;
                } else if (chckbx.className == 'fake_checkbox_selected') {
                    chckbx.className = 'fake_checkbox';
                    inp.value = 0;
                }
            }
        }
    }
}

function checkCheckbox(inp, popupSuff) {
    var re = new RegExp('^sbOrder(.*)_(\\d+)$', 'i');
    var arr;

    if (re.test(inp.id)) {
        arr = re.exec(inp.id);
        if (arr && (typeof(arr) != 'undefined') && arr[2] && (typeof(arr[2]) != 'undefined')) {
            var chckbx = $('chkbx' + popupSuff + '_' + arr[2]);
            if (chckbx && (typeof(chckbx) != 'undefined')) {
                if (toInt(inp.value) > 0) {
                    chckbx.className = 'fake_checkbox_selected';
                } else {
                    chckbx.className = 'fake_checkbox';
                    inp.value = 0;
                }
            }
        }
    }
}