JAVASCRIPT: switch statement breaks formatting