Crystal Palace beat arch-rivals Brighton 2-1 in an action-packed game that had three red cards.