

// event handler: packet checkbox
$(".packets").click(function(event) {
    
    // Select All
    if (event.target.value == 0) {
        if (event.target.checked) {
            //select all
            $(".packets input[type=checkbox]").each(function() {
                this.checked = true;
            });
            
            //event.target.checked = false;
    
        } else {
            //unselect all
            $(".packets input[type=checkbox]").each(function() {
                this.checked = false;
            });
        }    
    } else {
        // uncheck select all option
        $(".packets input[type=checkbox]").each(function() {
            if (this.value == 0) {
                this.checked = false;
            }
        });
        
    }
});



$(document).ready(function(){
    
    //alert('foobar');


});