A GPX file has a bounds element that defines the coordinates of the bounding box of all the GPS points in the file. Here is an example:
<gpx version="1.0" ...>
<time>2007-10-24T02:45:26Z</time>
<bounds minlat="37.221354973"
minlon="-121.987776104"
maxlat="37.330222065"
maxlon="-121.892523821"/>
...
</gpx>
Here is how you can use the Google MAP API to center the routes based on the bounds element in the GPX file:
var b = xmlDoc.documentElement.getElementsByTagName("bounds");
var sw = new GLatLng(b[0].getAttribute("minlat"), b[0].getAttribute("minlon"));
var ne = new GLatLng(b[0].getAttribute("maxlat"), b[0].getAttribute("maxlon"));
var bounds = new GLatLngBounds(sw, ne);
map.setCenter(bounds.getCenter(), 12);
Here is the above code in action: Los Gatos, Stevens Creek Reservoir bike trail