google.load("maps", "2");
				// Call this function when the page has been loaded
        function initialize() {
			var locationId   = document.getElementById('locationId').value;
			var locationLat  = document.getElementById('locationLat').value;
			var locationLng  = document.getElementById('locationLng').value;
			var locationZoom = document.getElementById('locationZoom').value;
			var locationDesc = document.getElementById('locationDesc').value;
			
        var map = new google.maps.Map2(document.getElementById("location-manager"));
		  
			var icon = new GIcon(G_DEFAULT_ICON);
			icon.image = '/images/markers/image.png';
			icon.shadow = '/images/markers/shadow.png';
			icon.iconSize = new GSize(100,96);
			icon.shadowSize = new GSize(148,96);
			icon.iconAnchor = new GPoint(0,96);
			icon.infoWindowAnchor = new GPoint(50,0);
			icon.printImage = '/images/markers/printImage.gif';
			icon.mozPrintImage = '/images/markers/mozPrintImage.gif';
			icon.printShadow = '/images/markers/printShadow.gif';
			icon.transparent = '/images/markers/transparent.png';
			icon.imageMap = [27,0,30,1,33,2,35,3,60,4,99,5,99,6,99,7,99,8,99,9,99,10,99,11,99,12,99,13,99,14,99,15,99,16,99,17,99,18,99,19,99,20,99,21,99,22,99,23,99,24,99,25,99,26,99,27,99,28,99,29,99,30,99,31,99,32,99,33,99,34,99,35,99,36,99,37,99,38,99,39,98,40,96,41,94,42,91,43,88,44,2,45,2,46,2,47,2,48,2,49,2,50,2,51,2,52,2,53,2,54,2,55,2,56,2,57,2,58,2,59,2,60,2,61,2,62,2,63,2,64,2,65,2,66,2,67,2,68,2,69,2,70,2,71,2,72,2,73,2,74,2,75,2,76,2,77,2,78,2,79,2,80,2,81,2,82,2,83,2,84,2,85,2,86,2,87,2,88,2,89,2,90,2,91,2,92,2,93,2,94,2,95,0,95,0,94,0,93,0,92,0,91,0,90,0,89,0,88,0,87,0,86,0,85,0,84,0,83,0,82,0,81,0,80,0,79,0,78,0,77,0,76,0,75,0,74,0,73,0,72,0,71,0,70,0,69,0,68,0,67,0,66,0,65,0,64,0,63,0,62,0,61,0,60,0,59,0,58,0,57,0,56,0,55,0,54,0,53,0,52,0,51,0,50,0,49,0,48,0,47,0,46,0,45,0,44,0,43,0,42,0,41,0,40,0,39,0,38,0,37,0,36,0,35,0,34,0,33,0,32,0,31,0,30,0,29,0,28,0,27,0,26,0,25,0,24,0,23,0,22,0,21,0,20,0,19,0,18,0,17,0,16,0,15,0,14,0,13,0,12,0,11,0,10,0,9,0,8,0,7,0,6,0,5,0,4,0,3,0,2,10,1,13,0];
			
			// Set up our GMarkerOptions object
			markerOptions = { icon:icon };
			var markers = new google.maps.Marker(
			new google.maps.LatLng(locationLat, locationLng),
				{ 'title' : locationDesc, 'icon' : icon }
			);
			map.addOverlay(markers);
			
         // SET CENTRE
         function zoomAndCenterMap()
			{
				var bounds = new google.maps.LatLngBounds();
				
	 
				if (bounds == null) {
				 // zoom and center over NZ
					 map.setCenter(new google.maps.LatLng(-41, 175),
											  5,
											  G_NORMAL_MAP);	// G_HYBRID_MAP
				}
				else {
                var zoom = Math.max(1, locationZoom);
                map.setCenter(new GLatLng(locationLat, locationLng), zoom);
				}
			}
			
			
        // ADD CONTROLS 
		  map.addControl(new google.maps.MapTypeControl());
        map.addControl(new google.maps.SmallMapControl());
		  var overviewMap = new google.maps.OverviewMapControl();
        map.addControl(overviewMap);

        map.enableDoubleClickZoom();
        map.enableContinuousZoom();
		  zoomAndCenterMap();
      }
      google.setOnLoadCallback(initialize);