Thanks for all the tips.
I went to my friends this weekend to help him with it.
Checked the event logs and device manager. No problems listed there.
Reformatted and reinstalled XP, still had the same problem.
Reformatted and installed Win2K, still had the same problem.
Reformatted and installed XP again, still had the same problem.
Flashed the BIOS and cleared CMOS, the problem went away, but the USB mouse no longer worked.
I checked the BIOS and saw that USB was disabled.
After enabling it, the problem returned and once again it took 20 minutes to boot.
I now realized there was a USB problem. I tried plugging the mouse into the front USB ports while the system was on, and I got an endless series of messages about a USB device malfunctioning.
I pulled the front USB wire off the mobo headers. Problem fixed.
Apparently, it was hooked up wrong. Still seems weird to me, but in both XP and 2K, it looks like the OS was spending 20 minutes trying to correctly detect the front USB ports, then giving up and disabling them.
Anyway, after about 12 hours of troubleshooting we finally got it fixed.