Nested If Example In Javascript