if (GBrowserIsCompatible()) {

	Base.Map = {
		icon: new GIcon(),
		defaultArea: new GLatLng(50.73229258662642, -1.8835651874542236),
		defaultZoom: 13,
		defaultIconOptions: {
			image: "http://www.basecreativeagency.com/images/base-marker.png",
			shadow: "http://labs.google.com/ridefinder/images/mm_20_shadow.png",
			iconSize: new GSize(32, 32),
			shadowSize: new GSize(48, 32),
			iconAnchor: new GPoint(16, 30),
			infoWindowAnchor: new GPoint(5, 1)
		},
		setIcon: function(options){
			options = options || Base.Map.defaultIconOptions;
			for (option in options) {
				Base.Map.icon[option] = options[option];
			}
		},
		createMarker: function(map, place){
			place.title = place.title || '';
			var gmarker = new GMarker(new GLatLng(place.lat, place.lng), {
				icon: Base.Map.icon,
				title: place.title
			});
			a = map;
			b = gmarker;
			map.addOverlay(gmarker);
			if (place.url) {
				GEvent.addListener(gmarker, "click", function(){
					document.location = place.url;
				});
			}
		},
		createMarkers: function(map, markers) {
			$j.each(markers, function(){
				Base.Map.createMarker(map, this);
			});
			if (markers.length == 1) {
				map.setCenter(new GLatLng(markers[0].lat, markers[0].lng), Base.Map.defaultZoom);
			}			
		},
		init: function(divId){
			divId = divId || 'img-gallery';
			Base.Map.setIcon();
			var map = new GMap2(document.getElementById(divId));
			
			map.setCenter(Base.Map.defaultArea, Base.Map.defaultZoom);
			map.addControl(new GLargeMapControl3D());
			map.enableScrollWheelZoom();
			
			return map;
		}
		
	};
}