First thing to do is start the system using safe boot. Do this by holding down shift while you boot the system. If you can get into the system, then you know the issue is with a startup item and you should disable all of them. Then you can reenable them one at a time until you find the one that's causing you problems.
If that doesn't work, fish out your 10.5 install disc, boot from it, and then run Disk Utilities from the Utilities menu. Have it do a repair permissions and repair disk operation. While you're in Disk Utility, check for the line that says anything about SMART Status, and if it says Failed, you need a new hard drive. Call Apple if the system is still under warranty. Otherwise, you can find take apart guides online if you want to attempt it yourself, or you can take it to an Apple repair shop in your area.
If either of those doesn't fix it, then you'll have to do a fresh install.