Determines which animate() function to use.