var GoogleMap = {
	map : null,
	geocoder : null,
	icon : null,
	load : function () {
		if (GBrowserIsCompatible()) {
			this.map = new GMap2(document.getElementById("google-maps"));
			this.geocoder = new GClientGeocoder();
			this.icon = new GIcon(G_DEFAULT_ICON);
			
		    this.map.setCenter(new GLatLng(51.517450,-0.147850), 16);
			this.map.addControl(new GSmallMapControl());
			this.setAddress('51.517450,-0.147850');

		  }
	},
	setAddress : function (address) {
		var obj = this;
	
		this.setIcon();
		
		if (this.geocoder) {
			this.geocoder.getLatLng( address,
				function(point) {
					if (!point) {
						alert(address + " not found");
					} else {
						obj.map.setCenter(point, 16);
						obj.map.addOverlay(new GMarker(point, obj.icon));
					} //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(0,0);
		this.icon.infoWindowAnchor = new GPoint(0, 0);
		this.icon.infoShadowAnchor = new GPoint(0, 0);
	}
}