function init( dom_id, points, zoom, draw_polys, center, map_type ) {
  if (GBrowserIsCompatible()) {
    if(center === true){
      // center map on middle of germany
      map_x = 10.323486;
      map_y = 51.5;
    } else {
      map_x = points[0][1];
      map_y = points[0][0];
    }
    
    var map = new GMap2(document.getElementById(dom_id));
    
    map.setCenter(new GLatLng( map_y, map_x ), zoom);

    if(map_type){
      switch(map_type){
        case "normal":
          mt = G_NORMAL_MAP
        break;
        case "hybrid":
          mt = G_HYBRID_MAP
        break;
        case "satellite":
          mt = G_SATELLITE_MAP
        break;
      }
      map.setMapType(mt);
    }

    map.setUIToDefault();

    var markers = new Array();

    var yellow_icon = new GIcon(G_DEFAULT_ICON);
    yellow_icon.image = "http://maps.gstatic.com/intl/de_ALL/mapfiles/marker_yellow.png";
    yellow_icon.clickable = true;
    yellow_icon.iconAnchor = new GPoint(13,34);

    var green_icon = new GIcon(G_DEFAULT_ICON);
    green_icon.image = "http://maps.gstatic.com/intl/de_ALL/mapfiles/marker_green.png";
    green_icon.clickable = true;
    green_icon.iconAnchor = new GPoint(13,34);
    markers[0] = yellow_icon;
    markers[1] = green_icon;

    // need to use a closure to keep the variables intact
    function createMarker(points) {
      var marker = new GMarker( new GLatLng( points[0], points[1] ), { title: points[2], icon: markers[ points[4] ] } );

      GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml( points[3] ); }
      );
      return marker;
    }

    map.addOverlay( createMarker(points[0]) );

    // next to
    for (var i = 1; i < points.length; i++) {
      map.addOverlay( createMarker(points[i]) );
    }

    // draw polys
    if( draw_polys ){
      for (var i = 1; i < points.length; i++) {
        map.addOverlay( new GPolyline( [ new GLatLng( points[0][0], points[0][1] ), new GLatLng( points[i][0], points[i][1] ) ] , "#AA0000", 2, 5.0 ) );
      }
    }
  }
}
