/*

*/
    var map;
    function loadMap() 
    {
			if (typeof(Darstellung)=="undefined")
 				return;
 									
			if (Darstellung == "top5")
			{
				if (GBrowserIsCompatible()) 
				{
					map = new GMap2(document.getElementById("map"));
					geocoder = new GClientGeocoder();

					showAddressTop5(LocationAdresse);
				}	
			}	
			if (Darstellung == "detail")
			{
				if (GBrowserIsCompatible()) 
				{
			
					map = new GMap2(document.getElementById("map"));
					geocoder = new GClientGeocoder();
				
					showAddressLocationDetail(LocationAdresse);
				}	
			}	
			
    }
    
    

    
  //Original: GoogleMaps  
 function showAddressTop5(address) 
 {
		if (geocoder) 
		{
			geocoder.getLatLng
				(address,
				function(point) 
				{
				if (!point) 
				{
					clearMap();
					//Default-Koordinaten, wenn Adresse nicht gefunden wurde
					var myGeographicCoordinates = new GLatLng(52.30,13.17);      
	        map.setCenter(myGeographicCoordinates, 5);

					//alert(address + " not found");
				} 
				else 
				{
					clearMap();
					map.setCenter(point, 10);
			    var aMarker = new GMarker(point);
				  map.addOverlay(aMarker);
				}
      }
    );
  }
}   


  //Original: GoogleMaps  
 function showAddressLocationDetail (address) 
 {
		if (geocoder) 
		{
				map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());

			geocoder.getLatLng
				(address,
				function(point) 
				{
				if (!point) 
				{
					clearMap();
					//Default-Koordinaten, wenn Adresse nicht gefunden wurde
					var myGeographicCoordinates = new GLatLng(52.30,13.17);      
	        map.setCenter(myGeographicCoordinates, 5);

					//alert(address + " not found");
				} 
				else 
				{
					clearMap();
					map.setCenter(point, 15);
			    var aMarker = new GMarker(point);
				  map.addOverlay(aMarker);
				}
      }
    );
  }
}   

function clearMap()
{
  map.clearOverlays();
} 
    

