If you got the restore media with the system, it's a pretty simple matter of just booting from the OS restore disc, and then before you install the OS, you can launch a utility to reset the admin password on the system.

Now if you didn't get the restore media, you're pretty much stuck. Your only real option is to try and find a copy of a Mac OS X 10.5 retail disc and use that.