when did the democratic and republican parties switch ideologies