Georgiy,
Чекбоксы должны располагаться до функции.
<input type='checkbox' name='value1' value='1'>
<input type='checkbox' name='value2' value='2'>
<input type='checkbox' name='value3' value='3'>
<input type='checkbox' name='value10' value='10'>
(function () {
var checkbox = document.getElementsByTagName('input'), checkboxes = [];
for (var i = 0; i < checkbox.length; i++) {
if (checkbox[i].name.indexOf('value') != -1) {
checkboxes.push(checkbox[i].name);
checkbox[i].onchange = function () {
if (this.name == 'value10') {
for (var _i = 0; _i < checkboxes.length; _i++) {
document.getElementsByName(checkboxes[_i])[0].checked = 0;
};
} else {
document.getElementsByName('value10')[0].checked = this.checked ? 1 : 0;
}
};
};
};
})();