I get an error on the following line:
if (GBrowserIsCompatible()) {
this is my code still not working
The answer from @Andrew S now seems to be the best, since v3 is now the only available version of the API. There is no GBrowserIsCompatible method, nor is there any replacement. I'd guess it would be best to check some web APIs (e.g., geolocation) you intend to use before invoking maps APIs.
Google Maps v2 to v3: Removing Obsolete Code