var map = null;
var geocoder = null;

function initialize(Latitude, Longitude, MapAddress) {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map_canvas"));
		map.addControl(new GLargeMapControl());
		//map.addControl(new GMapTypeControl());
		//map.setCenter(new GLatLng(Latitude, Longitude), 13);
		if ((Latitude == '0') || (Latitude == '')){
			geocoder = new GClientGeocoder();
			showAddress(MapAddress);
		}else{
			geocoder = new GClientGeocoder();
			map.setCenter(new GLatLng(Latitude, Longitude), 14);
			var marker = new GMarker(new GLatLng(Latitude, Longitude));
			map.addOverlay(marker);
		}
		//map.addControl(new GScaleControl());
		//geocoder = new GClientGeocoder();
	}
}
function showAddress(address) {
	if (geocoder) {
		geocoder.getLatLng(address,function(point) {
			if (!point) {
			//alert(address + " not found");
			//map_canvas.style.display = 'none';
			}else{
				map.setCenter(point, 15);
				var marker = new GMarker(point);
				map.addOverlay(marker);
				//marker.openInfoWindowHtml(address);
			}
		}
	)
}
}

/*
var map = null;
    var geocoder = null;

    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        
        
        map.addControl(new GLargeMapControl());
        //map.addControl(new GMapTypeControl());
            
        //map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        
        //map.addControl(new GScaleControl());
        
        geocoder = new GClientGeocoder();
      }
    }

    function showAddress(address) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              //alert(address + " not found");
            } else {
              //var overIcon = new GIcon();
				//Icon.image = "images/oaegmarker.gif";
				//Icon.shadow = "path to your icon shadow";
				//Icon.iconSize = new GSize(12, 20);
				//Icon.shadowSize = new GSize(22, 20);
				//Icon.iconAnchor = new GPoint(6, 20);
				//Icon.infoWindowAnchor = new GPoint(6, 1);
				//Icon.infoShadowAnchor = new GPoint(13, 13); 
			
			  map.setCenter(point, 13);
              //var marker = new GMarker(point,Icon);
			  var marker = new GMarker(point);
              map.addOverlay(marker);
              //marker.openInfoWindowHtml(address);
			    
            }
          }
        );
      }
    }
*/
