<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8">
  <title></title>
  <style type="text/css">       
  </style>
 </head>
 <body>  
  <input  id="big" type="checkbox"   onclick="bigChange(this)"/>ALL
  <br />
  <input name="small" type="checkbox"  onclick="smallChange(this)" value=""/>A<br />
  <input name="small" type="checkbox"  onclick="smallChange(this)" value=""/>B<br />
  <input name="small" type="checkbox"  onclick="smallChange(this)" value=""/>C
 </body>
</html>
<script type="text/javascript">
    function bigChange(obj) {var smObj = document.getElementsByName("small");
        if (obj.checked == false) {           
            for (var i = 0; i < smObj.length; i++)
                smObj[i].checked = false;
        }else {
         for (var i = 0; i < smObj.length; i++)
                smObj[i].checked = true;
        }
    }
    function smallChange(obj) {
        var smObj = document.getElementsByName("small");
        var bigObj = document.getElementById("big");       
        if (obj.checked == false){
            bigObj.checked = false;}
        else {
            var b = true;
            for (var i = 0; i < smObj.length; i++) {
                if (smObj[i].checked == true){
                    b = true;}
                else{b=false;
                 break;}
            }
            if (b == true){
                bigObj.checked = true;}
            else{bigObj.checked=false;}
        }
    }
</script>