// constructeur de la classe
function MapOfthedead( container, options, callback )
{
	//----------- container -----------------
	if ( typeof(container) == 'string' ) {
		this.container	= document.getElementById(container);
	} else if ( typeof(container) == 'object' ) {
		this.container	= container;
	}

	//------------ options ------------------
	this.center		= [0, 0];
	this.zoom		= 1;
  	
	for ( var i in options ) {
		this[i] = options[i];
	}
	
	//-------------- init -------------------
	this.map = new google.maps.Map2(this.container);
	
	if ( typeof(callback) == 'function' ) {
		google.maps.Event.addListener(this.map, 'load', callback);
	}
	
	this.map.setCenter(
		new google.maps.LatLng(this.center[0], this.center[1]),
		this.zoom
	);
  	
	this.map.addControl(new google.maps.LargeMapControl());
	this.map.addControl(new google.maps.MapTypeControl());

	//------------- modules -----------------
	this.geocoder = null;

	this.map.enableContinuousZoom();
}
  
MapOfthedead.prototype.addMarker = addMarker;
  
function addMarker( point, title, html, icon, options ) {
	var marker = new google.maps.Marker(
		new google.maps.LatLng(point[0], point[1]),
		{ 'title'	: title, 'icon'	: icon }
	);

	google.maps.Event.addListener(marker, 'click', function() {
		marker.openInfoWindowHtml(html);
	});

	this.map.addOverlay(marker);
}

MapOfthedead.prototype.getGeocoder = getGeocoder;
  
function getGeocoder(  ) {
	if ( this.geocoder == null ) {
		this.geocoder = new google.maps.ClientGeocoder();
	}
	
	return this.geocoder;
}
