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
2010-07-20 04:31:35