JavaScript with Java Switch