// Check browser compatibility and return error if not
if (!GBrowserIsCompatible()) {

if (document.getElementById) {
	document.getElementById("map").innerHTML = '<div style="padding: 2em; color: #FF0000; font-size: 120%; font-weight: bold;">Your browser is not compatible with the Google Maps API, and therefore cannot display the map. Check the <a href="help.html">help page</a> for a list of compatible browsers</div>';
} else {
	alert('Your browser is not compatible with the Google Maps API, and therefore cannot display the map. Check http://www.perplexcitymap.com/help.html for a list of compatible browsers');
}

// If compatible initialise map
} else {
   
var map = new GMap2(document.getElementById("map"),{logoPassive:true});

// Setup tile layer
var PXCtilelayer = [new GTileLayer(new GCopyrightCollection(),2,5)];

// Set path to map tiles
PXCtilelayer[0].getTileUrl = function(a,b) {
		return "/maptiles/index.php?x=" + a.x + "&y=" + a.y + "&zoom=" + b;
}

// Add map copyright
PXCtilelayer[0].getCopyright = function(a,b) {
        return {prefix:'Map Images &copy; ', copyrightTexts:['<a href="http://www.perplexcity.com/">Perplex City</a> / <a href="http://www.mindcandydesign.com/">Mind Candy</a>']};
}
      
// Create the GMapType
var PXCmaptype = new GMapType(PXCtilelayer, new GMercatorProjection(18), "PXC Map");
      
// Add the maptype to the map
map.addMapType(PXCmaptype);

// Add controls and center map
map.addControl(new GLargeMapControl());
map.enableDoubleClickZoom();
map.enableContinuousZoom();
map.setCenter(new GLatLng(0, 0), 3, PXCmaptype);

}