danik.js,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script>
document.onclick = function (e) {
var target = e && e.target || event.srcElement;
if(target.name == "ck[]") {
var ck = document.getElementsByName('ck[]'),
disabled = false;
for (var i=0; i<ck.length; i++) {
if(ck[i].checked && target.className == ck[i].className) {disabled=true; break}
}
for (var i=0; i<ck.length; i++) {
if(target.className != ck[i].className) ck[i].disabled = disabled
}
}
}
</script>
</head>
<body>
<label><input type="checkbox" name="ck[]" class="test" value="1" >1</label>
<label><input type="checkbox" name="ck[]" class="tovary" value="2" >2</label>
<label><input type="checkbox" name="ck[]" class="test" value="3">3</label>
<label><input type="checkbox" name="ck[]" class="tovary" value="3" >3</label>
</body>
</html>