	var map = null;
	var geocoder = null;
	
	function gmap_initialize() {
		if(GBrowserIsCompatible()) {
			map = new GMap2(document.getElementById("map_canvas"));
			map.addControl(new GLargeMapControl());
			map.addControl(new GMapTypeControl());
			map.setCenter(new GLatLng(52.059246, 6.128109), 7);
			geocoder = new GClientGeocoder();
			//52.059246,6.976318&spn=6.128109,16.864014&z=7
		}else{
			//alert('gaat niet werken!')
		}
	}
	
	function gminimap_initialize(address) {
		if(GBrowserIsCompatible()) {
			map = new GMap2(document.getElementById("map_canvas_mini"));
			//map.addControl(new GLargeMapControl());
			//map.addControl(new GMapTypeControl());
			geocoder = new GClientGeocoder();
			centerGoogleMap(address);
			//var point=alert(centerGoogleMap(address));
			
			
			
			//52.059246,6.976318&spn=6.128109,16.864014&z=7
		}else{
			alert('gaat niet werken!')
		}
	}

	function showAddress(info) {
		if(geocoder) {
			// Build the address to show
			var address = address+" "+info.suburb+" "+info.state+" "+info.zip+" "+info.country;
			address = address.replace(/N\/A/i, '');
			address = address.replace(/C\/O/i, '');
			geocoder.getLatLng(
			address, function(point) {
				if(!point) {
					// If the whole address was not found, strip out the street etc
					var address = info.suburb+" "+info.zip+" "+info.country;
					address = address.replace('/N\/A/i', '');
					address = address.replace('/C\/O/i', '');
					geocoder.getLatLng(
					address,
					function(point) {
						if(point){ 
							DrawOverlay(info, point);
						}
					});
					//alert(address + " not found");
				}
				else {
					DrawOverlay(info, point);
				}
			});
		}
	}
	
	function centerGoogleMap(info) {
		if(geocoder) {
			// Build the address to show
			var address = address+" "+info.suburb+" "+info.state+" "+info.zip+" "+info.country;
			address = address.replace(/N\/A/i, '');
			address = address.replace(/C\/O/i, '');
			geocoder.getLatLng(
			address, function(point) {
				if(!point) {
					// If the whole address was not found, strip out the street etc
					var address = info.suburb+" "+info.zip+" "+info.country;
					address = address.replace('/N\/A/i', '');
					address = address.replace('/C\/O/i', '');
					geocoder.getLatLng(
					address,
					function(point) {
						if(point){ 
							map.setCenter(point, 12);
							DrawOverlay(info, point);
						}
					});
				}
				else {
					map.setCenter(point, 12);
					DrawOverlay(info, point);
				}
			});
		}
	}

	function DrawOverlay(info, point) {
		var infoWindow = "<div style=\"font-weight: bold; font-size: 11px; width:350px; \"><br />" +
				""+info.name+"" +
				"<ul>" +
				"<li>Opdrachtgever: "+info.opdrachtgever+"</li>" +
				"<li>Plaats: "+info.suburb+"</li>" +
				"<li>Architect:  "+info.architect+"</li>" +
				"<li>meer <a target=\"_parent\" href=\""+info.link+"\" style=\"color:blue\">info</a> </li>" +
				"</ul>" +
				"<p style=\"font-size: 11px;\">"+info.description+"</div>";
				//(<a target=\"_parent\" href=\""+info.link+"\" style=\"color:blue\">info</a>)
		var marker = new GMarker(point);
		map.addOverlay(marker);
		GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(infoWindow);
		});
	}
	
	function gDo() {
		window.setTimeout("gBuild();", 1000);
	}
	
	
