Make sure you have at least 512 MGs of RAM (look at the RAM in the slot) add that to the 256 MG that's built into the logic board to see if you have enough to install 10.5. If not you will only be able to install 10.4.
Boot up from your system installation disk by inserting the disk and holding down the "C" key, and hitting the start button. Go to the second page pull down menu to Utilities -> Disk Utility. Select the drive on the left and format the drive. Then quit Disk Utilities and continue with the system installation.