I helped somebody with this the other night actually.
Have you tried going into single user mode, then typing in 'reboot'?
http://support.apple.com/kb/HT1492
You SHOULD get it all back, then when you've booted into OS X, go to startup disk and make sure that network startup is not selected.
After that I'd recommend going into the boot cd and selecting verify disk (the one that 10.5 is installed on). If it is damaged, click repair disk.
Hope this works.
If not however, it is probably best to contact Apple Support as it could be a hard disk issue, which is not advised to be fixed by anyone other than Apple; especially with 'closed machines' such as an iMac.