it would be better to avoid compat problems by simply creating a CSS rule that hides all the classes you want to hide: no loops, no compat issues, and faster performance.
Code:
<style>
body.hide .show { display: none; }
</style>
js:
Code:
document.body.className="hide"; // to hide
document.body.className=""; // to show