According to Gateway Support, the Gateway 505GR desktop computer uses an Intel (Ausberg) 915G motherboard,http://support.gateway.com/s/PC/R/3724/3724iv.shtml
Intel (Ausberg) 915G motherboard,http://www.ascendtech.us/itemdesc.asp?ic=MB4GWAUGSBURG
Scroll down to the photo with the sections marked in red.
In the top link, looking at the motherboard with the computer case open, the USB and Firewire (1394a) cables, can be seen attached to the motherboard near the letters D, E, and F.
In F that red cable is a SATA cable. One end attaches to the back of the SATA harddrive, (The angled end), and the other end of the SATA cable attaches to one of those SATA headers on the motherboard.
(SATA header = SATA connector on motherboard)
Preferred SATA header for the Harddrive is SATA 1.
DOESN'T matter though. That's the beauty of SATA. You can plug the SATA data cable into ANY SATA header on the motherboard, and BIOS will find the harddrive.
In the second link, looking at the motherboard photo shown, and comparing it to the view of the motherboard as mounted in the computer case, the Front Panel header is at the very Bottom Right.
Two rows of pins in a White rectangular shaped header,http://www.ascendtech.us/itemdesc.asp?ic=MB4GWAUGSBURG
(S points to Front Panel header)
[ The plastic front of a desktop computer is the Front Panel.
The area of pins on the motherboard, that the Front Panel wires go to, is the Front Panel header ]
A) Top row has Even numbered pins
B) Bottom row has Odd numbered pins.http://www.intel.com/support/motherboards/desktop/sb/CS-009016.htm
1) Power LED = Power On LED light
2) Hard Drive Activity LED = LED light that flashes (Usually red in color) when your harddrive is active. Being used.
3) Reset switch = Reset Button. The Reset switch is behind the Reset button. (IF the computer uses a Reset switch)
4) Power Switch = Power On switch
5) Forget about Pin 9. That's for 5 Volts DC - Out. Used by factory.
Which wires coming out of the Front Panel, are the Power On wires, Harddrive LED light wires, Power On switch wires, etc.?
Remove the Front Panel, and trace where the wires end.
IF, the wires already installed coming from the motherboard to the Front Panel, are Too short, you should make notes before you remove them from the motherboard.
Note what color pair of twisted wires, went to where, in the Front Panel.
Compare to the chart of the Front Panel header given above.
(IF any wires are still connected to the Front Panel header on the motherboard)
Once the Front Panel is removed, it's usually pretty easy to trace the two wires up to the Power On switch.
Same for the Power On LED light.
Again, same for the HarDDrive activity LED light.
The SATA harddrive requires a DATA cable, and a SATA power cable.
The connector for a Data cable has 7 contact pins. It is the shorter connector.http://en.wikipedia.org/wiki/File:SATA_Data_Cable.jpg
The connector can be at a 90 degree angle as shown, or a straight connector.
IF the data cable has an angled connector, it plugs into the Harddrive.
Straight connector goes to the motherboard.
The connector for a SATA power cable has 15 contact pins. It is the longer connector,http://www.playtool.com/pages/psuconnectors/connectors.html#sata
Note the L shape of the connectors for the SATA data cable, and SATA power cable.
This is a 4-pin standard Peripheral power cable. Commonly misnomered as a 'Molex' power cable,http://www.playtool.com/pages/psuconnectors/connectors.html#peripheral
IF, the SATA harddrive has a provision for a SATA power cable, AND a 4-pin standard Peripheral power cable, ONLY use just the SATA power cable.
Using both power cables will burn up the harddrive.
May not happen immediately in some cases, but WILL eventually happen.
For additional questions please post in a Comment.