// Google maps locations 
        var map = null;
        var geocoder = null;        
        var centered = false;
        var bounds = null;
        var marker_count = 0;
        var min_zoom = 12; // hack!
        var zlevel = null;
        var newCenter = null;
        var latlongs = 0;
        var addrs = 0;
        
        // Create a base icon for all of our markers that specifies the shadow, icon dimensions, etc.
        var baseIcon = new GIcon();
        baseIcon.iconSize = new GSize(32, 32);
        baseIcon.iconAnchor = new GPoint(16, 32);
        baseIcon.infoWindowAnchor = new GPoint(9, 2);
        baseIcon.shadow = "/_img/shadow.png";
		baseIcon.infoShadowAnchor = new GPoint(18, 25);
        baseIcon.shadowSize = new GSize(59, 32);

        // Re-Zooms and Centers to include all the markers
        function smartZoom(){
            if(marker_count > 0 && !centered){  
                zlevel = map.getBoundsZoomLevel(bounds);
				if(zlevel > 13 && !centered){ zlevel = min_zoom ; } // min zoom level
                newCenter = bounds.getCenter();
                map.setCenter(newCenter,zlevel);
            }
        }
        
        // Creates a marker with correct number
        function createMarker(point, index, windowtext) {
            var icon = new GIcon(baseIcon);
            icon.image = "/_img/blue.png"; // icon.image = "mapicons/iconb" + index + ".png";
            var marker = new GMarker(point, icon);
            
            if(windowtext != ""){
                GEvent.addListener(marker, "click", function() {
                marker.openInfoWindowHtml(windowtext);
                });
            }
            
            marker_count++;
            bounds.extend(point);
            return marker;
        }

        function showLatLng(lat,lon,index,windowtext) {
            var point = new GLatLng(lat,lon);
            if(index == 0){
                centered = true;
                map.setCenter(point, 10);
            }
            map.addOverlay(createMarker(point, index, windowtext));
            latlongs++; //Just used for debugging purposes        
        }

        function showAddress(address,index,windowtext) {
          if (geocoder) {
            geocoder.getLatLng(
              address,
              function(point) {
                if (!point) {
					// no address found
                } else {
                    if(index == 0){
                        centered = true;
                        map.setCenter(point, 10);                    
                    }
                    map.addOverlay(createMarker(point, index, windowtext));
                    //map.setCenter(bounds.getCenter(),map.getBoundsZoomLevel(bounds));
                    smartZoom();
                }
              }
            );
          }
        }
