Jim Carrey was Hollywood’s $20 million man. But when Eternal Sunshine of the Spotless Mind came along, he took a pay cut but it paid off.