/*
 * TMap
 **********
 */
function TMap() {
	this.isInitialized = false;
}

TMap.prototype = {

	/*
	 * Initializes map object.
	 * Should be called in onload event of window element for better performance (see Google Map API specification).
	 */
	_init: function (params, isEditable) {
		this.map              = this.__initGMap(params);
		this.isEditable       = isEditable;
		this.isInitialized    = true;
	},

	_free: function () {
		if (typeof(GUnload)!='undefined')
			GUnload();
	},

	/*
	 * Initializes Google Map object
	 */
	__initGMap: function(params) { // @private
		var map, container = $(params.mapContainerLocator);
		if (GBrowserIsCompatible() && container.size()) {
			map = new GMap2(container.get(0), {draggableCursor: 'default', backgroundColor: '#99B3CC'});
			map.setCenter(new GLatLng(0, 0), 1);
			map.enableScrollWheelZoom();
			map.enableContinuousZoom();
			if (!params.noMapControls) {
				map.addControl(new GSmallMapControl());
				map.addControl(new GMapTypeControl());
				map.removeMapType(map.getMapTypes()[1]);
//				map.removeMapType(G_SATELLITE_TYPE);
				map.addMapType(G_PHYSICAL_MAP);
			}
			map.setMapType(G_PHYSICAL_MAP);
		}
		return map;
	}

	/*
	_enumMapMarkers: function (func) {
		for (var i=0, cnt=this.markers.length; i<cnt; i++) {
			if (func(i, this.markers[i]))
				return;
		}
	},

	_getMarkerByIndex: function (index) {
		return (index in this.markers) ? this.markers[index] : null;
	},

	_getMarkersCount: function () {
		return this.markers.length;
	},
	*/
}