Probably the fan/clutch.

I believe the problem is independent of the idle, though. It is probably heating up when you're stopped and working fine when you're moving.