//*** Google Geraffel
		
var address ="Kremmenerstr. 9-11 D-10435 Berlin";
var map = null;
var geocoder = null;

function googleMap() 
{
	//alert('googleMap called ..');
	mapLoaded = 1;
	geocoder = new GClientGeocoder();
	
	if (GBrowserIsCompatible()) 
	{
		// Das Element f&uuml;r die Anzeige suchen
		var m = $("#map")[0];
		
		// Landkarte darstellen
		if (m) 
		{
			var map = new GMap2(m);
			
			if (geocoder) 
			{
				geocoder.getLatLng( address, function(point) 
				{					
					if (!point) {
						alert(address + " nicht gefunden");
					
					} else {
						
						
						// ==================================================
						// Create some custom icons
						
						var KleeIcon = new GIcon();
						KleeIcon.image = "../img/klee.png";
						//KleeIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
						KleeIcon.iconSize = new GSize(46, 42);
						//KleeIcon.shadowSize = new GSize(37, 34);
						KleeIcon.iconAnchor = new GPoint(15, 36);
						KleeIcon.infoWindowAnchor = new GPoint(22, 32);
						//KleeIcon.infoShadowAnchor = new GPoint(18, 25);
						KleeIcon.transparent = "../img/klee.png";
						//KleeIcon.printImage = "coldmarkerie.gif";
						//KleeIcon.mozPrintImage = "coldmarkerff.gif";
						
						// An array of GIcons, to make the selection easier
						var icons = [];
						icons[0] = KleeIcon;
						
						
						// ==================================================
						// A function to create a tabbed marker and set up the event window
						// This version accepts a variable number of tabs, passed in the arrays htmls[] and labels[]
						function createTabbedMarker( point, htmls, labels, what, icontype) {
							// Dont try to unroll this function. It has to be here for the function closure
							// Each instance of the function preserves the contents of a different instance
							// of the "marker" and "html" variables which will be needed later when the event triggers.
							
							if(icontype===undefined) icontype = 0;
							
							//var marker = new GMarker(point, {id:what, name:"foo", description:"baz"});
							var marker = new GMarker(point, icons[icontype]);
							// new GIcon(G_DEFAULT_ICON, "klee.png")
							//var marker = new GMarker(point);
							
							GEvent.addListener(marker, "click", function() {
								// adjust the width so that the info window is large enough for this many tabs
								if (htmls.length > 2) {
									htmls[0] = '<div style="width:'+htmls.length*88+'px">' + htmls[0] + '<\/div>';
									//  style="width:'+htmls.length*88+'px"
								}
								
								var tabs = [];
								
								for (var i=0; i<htmls.length; i++) {
									tabs.push(new GInfoWindowTab(labels[i],htmls[i]));
								}
								//marker.openInfoWindowTabsHtml(tabs);
							});
							return marker;
						}
						// ==================================================
						
						
						


					/*
						////////////////////////////////////////////////////////
						//  ======== Add a map overview ========================
						map.addControl(new GOverviewMapControl(new GSize(160,110)));
						var ovmap;
						//  ======== A function to adjust the positioning of the overview ========
						function positionOverview(x,y) {
							var omap=document.getElementById("map_overview");
							omap.style.left = x+"px";
							omap.style.top = y+"px";
							
							// == restyling ==
							omap.firstChild.style.border = "1px solid gray";
							omap.firstChild.firstChild.style.left="2px";
							omap.firstChild.firstChild.style.top="2px";
							omap.firstChild.firstChild.style.width="190px";
							omap.firstChild.firstChild.style.height="190px";
						}
						
						//  ======== Cause the overview to be positioned AFTER IE sets its initial position ========
						setTimeout("positionOverview(558,254)",1);
						////////////////////////////////////////////////////////
					*/
						
						
						
						
						
						// ==================================================
						// Sonstiges (muss vor add.Overlay)
						
						// Zoomlevel 0-20
						var zoomLevel = 15;
						
						// Zentrum setzen
						//map.setCenter(point, zoomLevel);
						//map.setCenter(new GLatLng(52.539000,13.404000), zoomLevel);
						map.setCenter(new GLatLng(52.540000,13.408900), zoomLevel);						
						
						// Bedienelemente f&uuml;r Zoom und Pan anzeigen
						//map.addControl(new GSmallMapControl());
						map.addControl(new GLargeMapControl());
						//map.addControl(new GScaleControl()); // ma&szlig;stab
						//map.addControl(new GMenuMapTypeControl(true,false)); // map, sat, hybrid
						

						
						
						// ==================================================
						// Set up the tabbed markers

						var marker = createTabbedMarker(point,[
									'<div style="width:340px;">KLEE GbR<br>Kremmenerstra&szlig;e 9-11, 10435 Berlin<br><br>&raquo; Parkpl&auml;tze auf dem Hof<\/div>', 
									'<div style="color:#333; text-align:left; text-transform:none;">KLEE GbR<br>Kremmenerstra&szlig;e 9-11, 10435 Berlin<br><br>&raquo; Parkpl&auml;tze auf dem Hof<\/div>', 
									'<div style="color:#333; text-align:left; text-transform:none;">KLEE GbR<br>Kremmenerstra&szlig;e 9-11, 10435 Berlin<br><br>&raquo; Parkpl&auml;tze auf dem Hof<\/div>'],
									['Anschrift','Öffentliche','Auto'],
									"that");
									
						map.addOverlay(marker);
						GEvent.trigger(marker,"click"); 
						
						/*
						// Set up three markers with info windows
						var marker = createMarker(point,'<div style="width:240px;color:#436600;text-align:left;text-transform:none;">KLEE GbR<br>Kremmenerstra&szlig;e 9-11<br>10435 Berlin<br><br>&raquo; Parkpl&auml;tze auf dem Hof<\/div>',"that")
						map.addOverlay(marker);
						*/
						
						/*/ alle weiteren m&uuml;ssen erkundet werden
						var address2 = "Alexanderplatz Berlin";
						geocoder.getLatLng(address2, function(point2) {
							var marker2 = createMarker(point2,'Das sollte der<br>Alexanderplatz sein.',"this")
							map.addOverlay(marker2);
						});
						//*/
						////////////////////////////////////////////////////////
						
						
						
						
						$("#anfahrt").addClass("hidden");

					} 
				});//ende geocoder callback function()
			}// end if(geocoder))
		}// end if(m))	
	}// end if browser
}// end googleMap function

