It appears you have a 5-7 year old system here and many problems can arise on a system that old (it may take some time to figure out the exact problem)
I'll suggest starting by checking that the CMOS battery (button-type battery on the motherboard) is at 3v since it going bad can cause strange things to happen (it is most commonly a CR2032 battery, available almost everywhere)
While you are inside the computer, look over the motherboard for any leaky or blown capacitors
Last, while looking at the back of the computer, there should be a label with the model shown, that info may be helpful
Last, if the computer hasn't been physically cleaned, I'll recommend doing that also (canned air works fine - turn off and unplug before cleaning)