
		var map;
		var geocoder;
		var directionsPanel;
		var directions;
		var routeNodes = new Array();
		

		function initialize() {
//		if(document.URL == 'http://www.urologie-bergedorf.de/kontakt.html?mode=test') {
			jQuery('body').append('<div id="map_container" style="margin-left:-365px; width:730px; margin-top:-300px; display:none;"></div>')
			jQuery('#map_container').append('<div id="TB_title"><div id="TB_ajaxWindowTitle">Ortskarte von Hamburg Bergedorf</div><div id="TB_closeAjaxWindow"><a style="margin-right: 205px;" title="drucken" href="javascript:window.print()">Drucken</a><a id="TB_closeWindowButton" href="#" onclick="closeThickbox();return false;">Schlie&szlig;en</a> oder ESC dr&uuml;cken</div></div>');
			jQuery('#map_container').append('<div style="width: 700px; height: 550px;" id="TB_ajaxContent"><div id="printAllWrap"> <div id="map_canvas" style="width:700px;height:550px;"></div> </div></div>');
			
			
			
			jQuery('#withJS').attr('class', '');
			jQuery('#withJS').unbind('click');
			jQuery('#withJS').click(function(){
				thickboxStartup();
				
				return false;
			});
			
			/*
			
		   if (GBrowserIsCompatible()) {
		      map = new GMap2(document.getElementById("map_canvas"));
		      geocoder = new GClientGeocoder();
		      map.setCenter(new GLatLng(53.49166,10.208245), 16);

		      var marker = new GMarker(new GLatLng(53.493453,10.206604));
		      var htmlInfoBox = "<p style='padding:0;margin:3px 0px;'><strong>Adresse:</strong></p><p style='padding:0; margin:0;'>Alte Holstenstra&szlig;e 16</p><p style='padding:0; margin:0;'>21031 Hamburg, Deutschland</p>";
		      GEvent.addListener(marker, "click", function() {
		    	  marker.openInfoWindowHtml(htmlInfoBox);
		      });
		      
		      var marker2 = new GMarker(new GLatLng(53.489865,10.20989));
		      var htmlInfoBox2 = "<p style='padding:0;margin:3px 0px;'><strong>Adresse:</strong></p><p style='padding:0; margin:0;'>Alte Holstenstra&szlig;e 69</p><p style='padding:0; margin:0;'>21029 Hamburg, Deutschland</p>";
		      GEvent.addListener(marker2, "click", function() {
		    	  marker2.openInfoWindowHtml(htmlInfoBox2);
		      });
		      

		      map.addOverlay(marker);
		      map.addOverlay(marker2);
		      
		    } else {
		      //$('map').innerHTML = '<p>Ihr Internet Browser unterst&uuml;zt die Google Maps API leider nicht.</p>';
		    }
		    */
//		}
		}
		
		function thickboxStartup() {
			jQuery('#map_container').css('display', 'block');
			
			// clickable overlay to shut down Thickbox
			var bodyTag = document.getElementsByTagName("body");
			/*
			var divOverlay = document.createElement("div");
			divOverlay.setAttribute("id", "tbOverlayApi");
			divOverlay.setAttribute("class", "TB_overlayBG");
			divOverlay.setAttribute("style", "width:100%;height:100%;z-index:101;position:fixed;top:0px;left:0px;");
			divOverlay.setAttribute("onclick", "closeThickbox()");
			bodyTag[0].appendChild(divOverlay);
			*/
			
			jQuery('body').append('<div id="tbOverlayApi" class="TB_overlayBG" onclick="closeThickbox()"></div>');
			
			
			
			
			document.getElementById("map_canvas").style.width = "698px";
			document.getElementById("map_canvas").style.height = "550px";
			//document.getElementById("tbOverlayApi").style.height = "100%";
			//document.getElementById("tbOverlayApi").style.width = "100%";
			
			//document.getElementById("closeThickboxButton").style.display = 'block';
			
			map = new GMap2(document.getElementById("map_canvas"));
		      geocoder = new GClientGeocoder();
		      map.setCenter(new GLatLng(53.49166,10.208245), 16);

		      var marker = new GMarker(new GLatLng(53.493453,10.206604));
		      var htmlInfoBox = "<p style='padding:0;margin:3px 0px;'><strong>Adresse:</strong></p><p style='padding:0; margin:0;'>Alte Holstenstra&szlig;e 16</p><p style='padding:0; margin:0;'>21031 Hamburg, Deutschland</p>";
		      
		      var marker2 = new GMarker(new GLatLng(53.489865,10.20989));
		      var htmlInfoBox2 = "<p style='padding:0;margin:3px 0px;'><strong>Adresse:</strong></p><p style='padding:0; margin:0;'>Alte Holstenstra&szlig;e 69</p><p style='padding:0; margin:0;'>21029 Hamburg, Deutschland</p>";
		      
		      map.addOverlay(marker);
		      map.addOverlay(marker2);
		        
		      marker.openInfoWindowHtml(htmlInfoBox);
		      var info = map.getInfoWindow(htmlInfoBox);
		        
		      GEvent.addListener(marker, "click", function() {
		       	marker.openInfoWindowHtml(htmlInfoBox);
		      });
		      GEvent.addListener(marker2, "click", function() {
			  	marker2.openInfoWindowHtml(htmlInfoBox2);
			  });
		        
//		        GEvent.addListener(map, "click", function(overlay, point){
//				map.addOverlay(new GMarker(point, {draggable:true}));
//			});
		        
		        

			var customUI = map.getDefaultUI();
			map.setUI(customUI);
			
			// shut down Thickbox when pressing 'ESC'
			document.onkeyup = function(e){ 	
				if (e == null) { // ie
					keycode = event.keyCode;
				} else { // mozilla
					keycode = e.which;
				}
				if(keycode == 27){ // close
					closeThickbox();
				}	
			};
		}
		
		
		function handleError() {
			var errorNode = document.createElement("p");
			errorNode.id = "routeError";
			errorNode.setAttribute("style", "color:red; padding:10px; margin:10px 0px 0px 15px; border:1px solid #000000;");
			errorNode.appendChild(document.createTextNode("Es konnte keine Route errechnet werden."));
			errorNode.appendChild(document.createElement("br"));
			errorNode.appendChild(document.createTextNode("Prüfen Sie bitte Ihre Eingabe."));
			// errorNode.appendChild(document.createElement("br"));
			// errorNode.appendChild(document.createTextNode(directions.getStatus().code));
			
			// var searchEmbed = document.createElement("iframe");
			// searchEmbed.id = "searchFrame";
			// searchEmbed.width = "0px";
			// searchEmbed.setAttribute("style", "position:absolute; left:-333333px;");
			// searchEmbed.src = "http://www.google.com/maps?f=q&source=s_q=output=js&hl=de&geocode=&q=isekei&btnG=Maps-Suche&vps=1&jsv=166d&sll=53.59339,9.989076&spn=0.006775,0.019269&callback=_xde_._xds&output=html";
			
		
			if (directions.getStatus().code !== G_GEO_SUCCESS) {
				document.getElementById("route").appendChild(errorNode);
				// document.getElementById("route").appendChild(searchEmbed);
				// var tabl = $("table");
				// alert(tabl);
				// document.getElementById("route").appendChild(tabl);
				// $("#route").append($("table"));
				
	   		} else if (directions.getStatus().code == G_GEO_UNKNOWN_ADDRESS) {
	     			alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + directions.getStatus().code);
	   		} else if (directions.getStatus().code == G_GEO_SERVER_ERROR) {
	     			alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + directions.getStatus().code);
	   
	   		} else if (directions.getStatus().code == G_GEO_MISSING_QUERY) {
	     			alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + directions.getStatus().code);
	     			
	  		} else if (directions.getStatus().code == G_GEO_BAD_KEY) {
	    		 	alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + directions.getStatus().code);

	   		} else if (directions.getStatus().code == G_GEO_BAD_REQUEST) {
	     			alert("A directions request could not be successfully parsed.\n Error code: " + directions.getStatus().code);
	    
	   		} else { alert("Ein unbekannter Fehler ist aufgetreten. Versuchen Sie es bitte erneut."); }
		}

		
		function closeThickbox() {
			var bodyTag = document.getElementsByTagName("body");
			var overlayDiv = document.getElementById("tbOverlayApi");
			bodyTag[0].removeChild(overlayDiv);

			jQuery('#map_container').css('display', 'none');
			//document.getElementById("closeThickboxButton").style.display = 'none';
			
			//initialize();
						
			tb_remove();
		}