Fixed JS bug and CSS show/hide effect