



function initialize() {

	if (GBrowserIsCompatible()) {
	
	        var map = new GMap2(document.getElementById("project_map_canvas"));
			
	        	        
			map.setUIToDefault();
	       
	        // Create a base icon for all of our markers that specifies the
	        // shadow, icon dimensions, etc.
	        var baseIcon = new GIcon(G_DEFAULT_ICON);
	       // baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
	        baseIcon.iconSize = new GSize(34, 29);
	        //baseIcon.shadowSize = new GSize(37, 34);
	        baseIcon.iconAnchor = new GPoint(9, 34);
	        baseIcon.infoWindowAnchor = new GPoint(9, 2);
	
	        // Creates a marker whose info window displays the letter corresponding
	        // to the given index.
			
	        function createMarker(point, info) {
	
				// Create a lettered icon for this point using our icon class
				//var letter = String.fromCharCode("A".charCodeAt(0) + index);
	          
				var letteredIcon = new GIcon(baseIcon);
				letteredIcon.image = "tl_files/images/skins/google_marker.png";
	
				// Set up our GMarkerOptions object
				markerOptions = { icon:letteredIcon };
				var marker = new GMarker(point, markerOptions);
	
				GEvent.addListener(marker, "click", function() {
					marker.openInfoWindowHtml(info);
				});
				return marker;
			}
			
			$longMap = 10.1953125;
			$langMap = 49.53091345580137;
			$zoomMap = 3;
			
			//counter = 0;
			$.each($(".project_places_item"), function () {
							
					$projectID = $(this).children()[0].innerHTML;
					$project = $(this).children()[1].innerHTML;
					$ort = $(this).children()[2].innerHTML;
					$link = $(this).children()[3].innerHTML;
					
					$long = $(this).children()[4].innerHTML;
					$lang = $(this).children()[5].innerHTML;
					

    				map.addOverlay(createMarker(new GLatLng($lang,$long ),
						'<span style="display:block;font-weight:bold;">'+$project+'</span><span style="display:block;">'+$ort+'</span><a style="display:block;margin-top:4px;" href="'+$link+'">zur Referenz</a>'));
									
								
					if ($(this).children()[0].innerHTML == $("#content .reference_box").attr("id")) {
						$longMap = $(this).children()[4].innerHTML;
						$langMap = $(this).children()[5].innerHTML;
						$zoomMap = 8;
					}
			});
			
			map.setCenter(new GLatLng($langMap, $longMap), $zoomMap);
    
	}
}
