change show() hide() to add/remove CSS classes instead

This should help performance a bit I hope. It's more important than ever
to add the CSS link now.