

var geomap = {
	map:null,
	
	initialize:function() {
		if (GBrowserIsCompatible()) {
			this.map = new GMap2(document.getElementById("map"));
		}		
	},
	
	lock:function() {
	    this.map.disableDragging();
	    this.map.disableInfoWindow();
	},
	
	addZoomControl:function() {
	    this.map.addControl(new GLargeMapControl());
	},
	
	centerWorld:function() {
		this.map.setCenter(new GLatLng(25, 10), 1);
	},
	
	showSatelite:function() {
		this.map.setMapType(G_SATELLITE_MAP);
	},

	showMap:function() {
		this.map.setMapType(G_NORMAL_MAP);
	},

	showHybrid:function() {
		this.map.setMapType(G_HYBRID_MAP);
	},
	
	createMarker:function(point) {		
		/*
		var icon = new GIcon();
		icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
		icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
		icon.iconSize = new GSize(12, 20);
		icon.shadowSize = new GSize(22, 20);
		icon.iconAnchor = new GPoint(6, 20);
		icon.infoWindowAnchor = new GPoint(5, 1);
	
		var marker = new GMarker(point, icon);
		*/
	
		var marker = new GMarker(point, G_DEFAULT_ICON);
		this.map.addOverlay(marker);
	
		return marker;
	},
	
	markContinent:function(id, name, lat, lng) {
		var point = new GLatLng(lat, lng);
		var marker = this.createMarker(point);
		GEvent.addListener(marker, "click", function() {
			window.top.document.location.href = "/guide.do#" + id;
			//marker.openInfoWindowHtml('<h2>' + name + '</h2>&raquo; <a href="javascript:showPlace(' + lat + ', ' + lng + ');">Show</a>');
			});
	},
	
	zoomBounds:function(south, west, north, east) {
	    var SW = new GLatLng(south, west);
	    var NE = new GLatLng(north, east);
	    var bounds = new GLatLngBounds(SW, NE);
	    var boundsZoom = this.map.getBoundsZoomLevel(bounds);
	    this.map.setCenter(bounds.getCenter(), boundsZoom);		
	}
};
