+2  A: 

It's not the style attribute that is the problem, you failed to access the elements themselves.

You are trying to access the elements as if they are global variables in the document object, that is only true in IE in quirks mode. You need to use the getElementById method. Replace:

document.chocolate

with:

document.getElementById('chocolate')

and corresponding for each element.

Guffa
I fixed the problem by pushing the switch statement at the end of the html. Thanks for your help.
Lawren