var GoogleMap = {
	map : null,
	geocoder : null,
	icon : null,
	zoom : 6,
	load : function (location, zoom) {
		if (GBrowserIsCompatible()) {
			
			if (typeof(zoom) == "undefined") {
				this.zoom = 6;
			} else {
				this.zoom = zoom;
			}
			
			this.map = new GMap2(document.getElementById("google-maps"));
			this.geocoder = new GClientGeocoder();
			//this.icon = new GIcon(G_DEFAULT_ICON);
		    this.map.setCenter(new GLatLng(53.799637,-1.54911), this.zoom);
			this.map.addControl(new GSmallMapControl());
			this.setAddress(location);
		  }
	},
	setAddress : function (address, aData, noMarker) {
		var obj = this;
	
		//this.setIcon();
		
		if (this.geocoder) {
			this.geocoder.getLatLng( address,
				function(point) {
					if (!point) {
						if (window.console) window.console.log(address + " not found");
					} else {
						
						obj.map.setCenter(point, obj.zoom);

						if (typeof(noMarker) == "undefined") {
							var marker = new GMarker(point);
							obj.map.addOverlay(marker);							
							GEvent.addListener(marker, "click", function() {
							     marker.openInfoWindowHtml('<div class="google-maps-marker">' + aData.logo + aData.url + "</div>");
							});
						} //if
						
					} //else
			});
		}
	},
	setIcon : function () {
		this.icon.image = IMAGES+"/other/google-maps-icon.png";
		this.icon.shadow = IMAGES+"/other/google-maps-icon-shadow.png";
		this.icon.iconSize = new GSize(60, 49);
		this.icon.shadowSize = new GSize(60, 49);
		this.icon.iconAnchor = new GPoint(10, 10);
		this.icon.infoWindowAnchor = new GPoint(0, 0);
		this.icon.infoShadowAnchor = new GPoint(0, 0);
	}
}