Does anybody know how i can make a dtree out of a multitude of checkboxes i have?

The check boxes have a parent child thing going on (or need to anyway)

Also it would be good to have the user able to tick the parent and for that to tick (untick) all the children?

A pointer to a tutorial would be a god send as i cant find anything like this.

I'm very very much a novice with js by the way, i just cant think of how to do this any other way!

Any help would be very gratefully appreciated indeed.