Javascript if statement style feature toggling