First up, connect to your desired network.
Settings -> Wireless & Networks -> WiFi Settings -> Menu (the button at the bottom of the handset) -> Advanced Settings -> Tick the box which says "Use Static IP".
You'll then need to enter the options specific to that network.
The screen should look like this -
If you're connected to a network, the IP address you're currently using will already be displayed (as it is in the top of the picture), enter that into the IP address pull down.
Your gateway will be the internal IP address of your networks router. You can get this by accessing a PC, going to the start menu, typing CMD and pressing enter. In the DOS window which opens, type ipconfig and press enter. You'll see a load of info displayed, you're looking for something called Default Gateway, take a note of that then enter it into Gateway section on the phone.
Netmask will always be 255.255.255.0
I think you can leave DNS blank as DNS should be handled by the default gateway.
The above may or may not fix the issue, but give it a shot and report back either way.