Crocodiles like snakes are unable to maintain a constant body temperature by physiological means. They are referred to as "cold-blooded" due to this fact. Ideal body temperature of a crocodile is around 30-33c, and to achieve such temperatures they move back and forth between warm and cool parts of their environment. During cooler weather they bask in the sun to heat up, and in hot weather they seek shaded, cool areas to avoid overheating.
Crocodiles will usually orientate themselves so that the maximum body surface is exposed to the sun. While the body heats up crocodiles will often open their mouths, allowing the brain to cool through evaporative cooling from their soft inner skin of mouth and their tongue. This "mouth-gaping" posture is also a behavioral display.