
var G_GEO_SUCCESS             = 200;
var G_GEO_BAD_REQUEST         = 400;
var G_GEO_SERVER_ERROR        = 500;
var G_GEO_MISSING_QUERY       = 601;
var G_GEO_MISSING_ADDRESS     = 601;
var G_GEO_UNKNOWN_ADDRESS     = 602;
var G_GEO_UNAVAILABLE_ADDRESS = 603;
var G_GEO_UNKNOWN_DIRECTIONS  = 604;
var G_GEO_BAD_KEY             = 610;
var G_GEO_TOO_MANY_QUERIES    = 620;

var map;

var reasons=[];   
reasons[G_GEO_SUCCESS]            = "";
reasons[G_GEO_MISSING_ADDRESS]    = "Missing Address: The address was either missing or had no value.";     
reasons[G_GEO_UNKNOWN_ADDRESS]    = "Unknown Address:  No corresponding geographic location could be found for the specified address."; 
reasons[G_GEO_UNAVAILABLE_ADDRESS]= "Unavailable Address:  The geocode for the given address cannot be returned due to legal or contractual reasons.";
reasons[G_GEO_BAD_KEY]            = "Bad Key: The API key is either invalid or does not match the domain for which it was given";
reasons[G_GEO_TOO_MANY_QUERIES]   = "Too Many Queries: The daily geocoding quota for this site has been exceeded.";                                   
reasons[G_GEO_SERVER_ERROR]       = "Server error: The geocoding request could not be successfully processed.";

/* http://code.google.com/apis/maps/ */
function loadMap(wobjectId,lat,lon,zoomLevel,iconPath) {
	/*alert(wobjectId+","+lat+","+lon+","+zoomLevel+", "+iconPath); */
	if (document.getElementById("map_"+wobjectId) == null) {
		return false;
	}
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("map_"+wobjectId));
		map.setCenter(new GLatLng(lat,lon),parseInt(zoomLevel));
		gMapType = map.getMapTypes();
		map.setMapType(gMapType[0]);  // [0] map [1] satellite [2] hybrid
		map.enableScrollWheelZoom();
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		/*map.addControl(new GOverviewMapControl());*/
		
		marker = new GMarker(map.getCenter());
		map.addOverlay(marker);
		
	} else {
		/*alert("Dieser Browser ist leider nicht mit Google Maps kompatibel.");*/
	}
}
