var GoogleMaps = {
	load : function (id) {
		if (GBrowserIsCompatible()) {
			this.map = new GMap2(document.getElementById(id));
			this.map.addControl( new GSmallMapControl() );
		}
	},
	placeIcon : function (img,img_background,lat,lng) {
		var icon = new GIcon();
		icon.image = img;
		icon.shadow = img_background;
		icon.iconSize = new GSize(100, 100);
		icon.shadowSize = new GSize(100, 100);
		icon.iconAnchor = new GPoint(30, 100);
		icon.infoWindowAnchor = new GPoint(0, 0);
		icon.infoShadowAnchor = new GPoint(0, 0);
		var p = new GLatLng(parseFloat(lat),parseFloat(lng));
		this.map.setCenter(p, 16);
		this.map.addOverlay(new GMarker(p, icon));
	},
	showDirections : function (fromObj, toObj) {
		this.destroy();
		this.directions = new GDirections(this.map);
		var searchStr  = fromObj.lat+','+fromObj.lng +' to '+toObj.lat+','+toObj.lng;
		this.directions.load(searchStr);
	},
	destroy : function () {
		this.map.clearOverlays();
	}
}
