I suggest you have Power Supply problems. A failing power supply will emulate all kinds of software problems.
Let's start with the easy stuff first.
How dirty is the computer inside, and the Power Supply? Has the inside of the computer, and the Power Supply, been cleaned on a regular basis?
(Computer off, and unplugged from power, computer case open. A can of compressed air is used to clean)
From there I would suggest testing the Power Supply, (Requires a multimeter, or a power supply tester), or replace the power supply with a known to be good unit, for a test.
Let me know if the computer is dirty inside, and if you need guidance on how to clean it. (Power Supply also)
From there, if you wish I can guide you on testing your power supply, or replacing with a known to be good unit, for a test.
Simply state in a Comment.
This is HP Support, and the download page for a manual which instructs on how to open your computer case, (Page 118)
With this manual I can also guide you in replacing the power supply.http://h10025.www1.hp.com/ewfrf/wc/manualCategory?lc=en&dlc=en&cc=us&lang=en&product=326832&
Why do I think it's a power supply issue?
You don't have enough power to turn the Processor on.
Power Supply's are rated in Wattage.
Voltage times Amperage = Wattage.
1) ALL the lights require less than 1 Watt of power.
2) EACH fan uses 2 to 3 Watts of power.
3) A typical Processor requires 51 to 125 Watts of power. Depends on what processor it is.
The Compaq Presario S4020WM Desktop PC, comes with an AMD Athlon XP 2400 processor. (2.4GHz)
When operating at full capacity, this processor can use up to 68.3 Watts.http://en.wikipedia.org/wiki/List_of_AMD_Athlon_XP_microprocessors
You have enough power to turn on lights, and spin fans, but not enough to turn the Processor on.