Imac stuck at logon


I have a 20inch Imac g5 with leapord 10.5 all of a sudden I turned on my mac and it booted to the logon screen which never happens, I entered my password the screen goes blue, and then goes back to the logon screen. I tried booting to safe boot but nothing changed it just asked for the password again. Please HElP!!!