Lizards and other cold-blooded critters bask in the sun to keep warm. But they also do it for the vitamin D, a new study finds.

"It's a longstanding assumption that thermoregulation is the only reason that lizards bask," said study leader Kristopher Karsten, a biologist at Texas Christian University. "Our results suggest that in addition to thermoregulation, vitamin D regulation appears to have a significant impact on basking behavior as well."

Chameleons, like humans and most other vertebrates, get vitamin D in two ways: They can absorb it from food, and they can produce it in their skin with an assist from UV radiation.

(Recent evidence suggests an increasing number of Americans suffer vitamin D deficiency, but the problem is largely related to those who don't drink milk, which is fortified with the vitamin, or who abstain from fish, which packs it naturally. Getting lots of sun is not the healthy answer; rather, it'll make you look like a lizard and could lead to deadly skin cancer.)

To test whether chameleons alter their sunning behavior based on dietary vitamin D intake, Karsten observed the behavior of two different groups of chameleons. One group had high internal vitamin D levels, thanks to a diet of crickets dusted with a vitamin D powder. The other group ate regular crickets and had low vitamin D.

The chameleons were then placed in individual outdoor enclosures that offered open area for direct sun, and a tree to offer filtered sun and shade.

Chameleons generally move from sun to shade throughout the day. But Karsten found that chameleons fed the low vitamin D diet compensated by increasing their exposure to the sun's UV rays. Chameleons with high vitamin D diets, on the other hand, limited their UV exposure.

"It appears that panther chameleons have the ability to gauge their internal vitamin D levels and alter their basking behavior accordingly," Karsten said in a statement.

And they do it with remarkable accuracy.

"The chameleons were as effective as mathematically possible by our methods at regulating toward optimal UV exposure for their vitamin D profile," he said. "We thought they were probably pretty good at regulating their UV exposure; we just didn't think they'd be this good."

It's not clear, however, by what mechanism they are able to sense their internal vitamin D levels, but Karsten thinks there may be a brain receptor sensitive to the vitamin.

"Given the ability for panther chameleons to precisely, accurately and effectively adjust basking behavior as a direct result of vitamin D3, [a brain vitamin D receptor] seems likely to occur in panther chameleons."

The results are published in the May/June issue of the journal Physiological and Biochemical Zoology.