Thank you for your reply. The problem with your code is that you need a click event with it (please correct me if I am wrong).
The checkbox can also be unchecked (it's checked/unchecked status is "remembered" in a cookie). This means that the click event is not always used (if someone unchecked the box and comes back to the site, the box will still be unchecked and no click is needed to mute it.
Thats why I used
Code:
if (document.getElementById('sound').checked){
So if checked play sounds, if not checked don't play them