function googleMapLoad() {
     if (GBrowserIsCompatible()) {
		googleMap = new GMap2(document.getElementById("dateDetailsGoogleMap"));
		googleMap.addControl(new GLargeMapControl());
		googleMap.addControl(new GMapTypeControl());
		googleGeocoder = new GClientGeocoder();
    }
    
    
}

function googleMapShowAddress(address) {
  googleGeocoder.getLatLng(
    address,
    function(point) {
      if (!point) {
        document.getElementById("dateDetailsGoogleMapContainer").style.display = 'none';
      } else {
      	googleGeocoder.getLocations(address, getAccuracy);
        googleMap.setCenter(point, 15);
      }
    }
  );
}

function getAccuracy(addressInfo) {
	/*var s = '';
		for (a in addressInfo.Placemark[0]) {
			s += a+': '+ addressInfo.Placemark[0][a];
		}*/
		//alert ("Inhalt: "+s);
		accuracy = addressInfo.Placemark[0].AddressDetails.Accuracy;
		if(accuracy < 4){
	        	document.getElementById("dateDetailsGoogleMapContainer").style.display = 'none';
	    }
		//alert ("Genauigkeit: "+addressInfo.Placemark[0].AddressDetails.Accuracy);
		//alert ("Genauigkeit: "+accuracy);
		place = addressInfo.Placemark[0];
	    point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]);
	    marker = new GMarker(point);
		var icon = new GIcon();
	       // icon.image = "../img/google_marker/marker.png";
	       // icon.shadow = "../img/google_marker/marker_shadow.png";
	    icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
	    icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
	    icon.iconSize = new GSize(12, 20);
	    icon.shadowSize = new GSize(22, 20);
	    icon.iconAnchor = new GPoint(6, 20);
	    icon.infoWindowAnchor = new GPoint(5, 1);
	    var marker = new GMarker(point, icon)
	    googleMap.addOverlay(marker);
	    marker.openInfoWindowHtml(place.address.replace(/,/g , "<br />"));
	    GEvent.addListener(googleMap, "click", function(marker, point) {
	 	marker.openInfoWindowHtml(place.address.replace(/,/g , "<br />"));
  	});
}
