function GMap(mapID) {
	if (GBrowserIsCompatible()) {
		this.zoomDefault = 13;
		this.zoom = this.zoomDefault;
		this.map = new GMap2(document.getElementById(mapID));
		this.map.setCenter(new GLatLng(44.064564, -93.216108),this.zoom); // MFH
	    this.map.enableContinuousZoom();
	    this.map.enableDoubleClickZoom();
	    this.map.disableScrollWheelZoom();
	    this.map.addControl(new GLargeMapControl());
//	    this.map.addControl(new GMapTypeControl());
//	    this.map.addControl(new GOverviewMapControl());
	    this.geocoder = new GClientGeocoder();
//		this.directions = new GDirections(map);
//		this.directions.load('Faribault, MN to Owatonna, MN');	    
//		alert('directions:'+this.directions.getStatus());
   
   
	    this.markerStyle = 'Google Traditional (pillow)';
	    this.markerColor = 'Desert Spice';
	    this.icon = new GIcon();
	    this.icon.image = 'http://google.webassist.com/google/markers/traditionalpillow/desertspice.png';
	    this.icon.shadow = 'http://google.webassist.com/google/markers/traditionalpillow/shadow.png';
	    this.icon.iconSize = new GSize(34,35);
	    this.icon.shadowSize = new GSize(34,35);
	    this.icon.iconAnchor = new GPoint(9,23);
	    this.icon.infoWindowAnchor = new GPoint(19,0);
	    this.icon.printImage = 'http://google.webassist.com/google/markers/traditionalpillow/desertspice.gif';
	    this.icon.mozPrintImage = 'http://google.webassist.com/google/markers/traditionalpillow/desertspice_mozprint.png';
	    this.icon.printShadow = 'http://google.webassist.com/google/markers/traditionalpillow/shadow.gif';
	    this.icon.transparent = 'http://google.webassist.com/google/markers/traditionalpillow/desertspice_transparent.png';
	}
};

//GMap.prototype.disableOverviewMap = function {
//	this.map.removeControl(GOverviewMapControl());
//};

//GMap.prototype.enableOverviewMap = function {
//	this.map.removeControl(GOverviewMapControl());
//   this.map.addControl(new GOverviewMapControl());
//};

GMap.prototype.setCenter = function(lat,lng,zoom){
	if (!zoom) var zoom = this.zoom;
//	alert('setCenter:'+lat+','+lng+','+zoom);
	var reCenter = new GLatLng(lat,lng,false);
	if (reCenter) {
//		alert('setCenter:'+reCenter);
		this.zoom = zoom;
		this.map.setZoom(zoom);
		this.map.panTo(reCenter);
//		this.map.setCenter(reCenter,zoom);
	}
};


GMap.prototype.setZoom = function(zoom){
	this.zoom = zoom;
	this.map.setZoom(zoom);
};


GMap.prototype.resetZoom = function(){
	this.zoom = this.zoomDefault;
	this.map.setZoom(this.zoom);
};


//GMap.prototype.getDirections = function(org,dest){
//	this.directions.load(org+' to '+dest);
//};

GMap.prototype.addMarker = function(x_name,x_street,x_city,x_state,x_zip,x_default) {
	var me=this;
	var fulladdr = x_street+','+x_city+','+x_state+','+x_zip;
	var infowindow = 'custom';
    var infowindowtext = '<span style="font: 12px Tahoma, Arial, Helvetica, sans-serif; color: #000;">' + 
    	'<strong>' + x_name +'</strong><br />' + x_street + '<br />' + 
    	x_city + ', ' + x_state + ' ' + x_zip + '</span>';
    this.geocoder.getLatLng (
      fulladdr,
	  function(point) {
	  	if(point) {
	        var marker = new GMarker(point, me.icon);
	        GEvent.addListener(marker, 'click', function() {
	        	marker.openInfoWindowHtml(infowindowtext);
	        });
	        me.map.addOverlay(marker);
	  		if(x_default) {
	  			me.map.setCenter(point, me.zoom);
	        	marker.openInfoWindowHtml(infowindowtext);
	        }
		}
	  }
	);
}


window.onunload = function() {
  GUnload();
}

