var map;

GMap2.prototype.zoom_to_bounds = function(bounds, zoom_offset) {
	zoom = this.getBoundsZoomLevel(bounds);
	if(zoom > 18) zoom = 18;
	if(zoom_offset) zoom = zoom + zoom_offset;
	this.setCenter(bounds.getCenter());
	this.setZoom(zoom);
}

function GMarker_poi(marker_data) {
	var marker_icon = new GIcon();

	marker_icon.image            = 'img/gmap/trader.png';
	marker_icon.iconSize         = new GSize(14,14);
	marker_icon.iconAnchor       = new GPoint(7,7);
	marker_icon.infoWindowAnchor = new GPoint(7,7);
	
	var ort_marker = new GMarker(new GLatLng(marker_data.lat, marker_data.lng), marker_icon);
	
	ort_marker.MDC_html  = '<div class="marker"><strong>'  + marker_data.title + '</strong></div><br />' + marker_data.adress;
	
	GEvent.addListener(ort_marker, "click", function() {
		this.openInfoWindowHtml(this.MDC_html);
	});
	
	return ort_marker;
}

function draw_map() {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map_canvas"));
		map.setCenter(new GLatLng(50.50491135492333, 7.175273895263672), 15);
		map.addControl(new GMapTypeControl());
		map.addControl(new GSmallMapControl());
	}
}
