This would be a good upgrade for the Ethernet shield
https://www.sparkfun.com/products/11287
Here’s the sample code which allows the wifi shield to detect wifi networks. And an example which shows how to send the SSID and Password to connect to a protected wifi network.
http://arduino.cc/en/Guide/ArduinoWiFiShield