function SmallMap() {
	var osm = null;
	var gmlLayer = null;
    var popup;
    
	small_map = new OpenLayers.Map (
			'small_directions',
			{ controls: [],numZoomLevels: 20, maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
              maxResolution: 156543.0399,units: "m",projection: new OpenLayers.Projection("EPSG:900913"),displayProjection: new OpenLayers.Projection("EPSG:4326") } );
	small_map.addControl(new OpenLayers.Control.MouseDefaults());
	small_map.addControl(new OpenLayers.Control.MousePosition());
	osm = new OpenLayers.Layer.TMS(
			"OpenStreetMap","http://tile.openstreetmap.org/",
			{ type: 'png', getURL: osm_getTileURL,displayOutsideMaxExtent: true,
			    attribution: '<a href="http://www.openstreetmap.org/">OpenStreetMap</a>' });

    gmlLayer = new OpenLayers.Layer.GML (
                "Informationen",                            // Name des Layers in der Legende
                "/metrico_libraries/offices_metrico.kml",                      // Datei festlegen
                {                                   // Optionen festlege
                    projection: new OpenLayers.Projection("EPSG:4326"),     // Projektion
                    format: OpenLayers.Format.KML,                  // Format
                    formatOptions: {
                        extractStyles: true,                    // Wegpunkte extrahieren
                        extractAttributes: true                 // Attributdaten extrahieren
                    }
                }
            );
			
	small_map.addLayer(osm);
	small_map.addLayer(gmlLayer);
	
	var selectControl = new OpenLayers.Control.SelectFeature (
				gmlLayer,
				{
					onSelect: function (feature) {
							selectedFeature = feature;
//							var content = '<div style="width:100;height:50;overflow:auto;"><strong>'+feature.attributes.name+'</strong><p class="popupcode">'+feature.attributes.description + '</p></div>';
                            var content = '<p><strong>'+feature.attributes.name+'</strong></p><p>'+feature.attributes.description + '</p>';

							popup = new OpenLayers.Popup.Anchored(
                                        "ptInfoPopup",                                                  // id
                                        new OpenLayers.LonLat(6.06,49.78520).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913")),
//                                        feature.geometry.getBounds().getCenterLonLat(),                 // lonlat
                                        new OpenLayers.Size(145,170),                                   // content size
                                        content,                                                        // content html
                                        null,                                                           // anchor
                                        true,                                                           // closebox
                                        function (evt) { selectControl.unselect(selectedFeature); }     // closebox callback
                                    );

//                            popup.keepInMap = true;
							feature.popup = popup;
							this.map.addPopup(popup);
						},
					onUnselect: function (feature) {
							this.map.removePopup(feature.popup);
							feature.popup.destroy();
							feature.popup = null;
						}
				} );
	small_map.addControl(selectControl);selectControl.activate();
	center = new OpenLayers.LonLat(6.28,49.63601).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));
	small_map.setCenter(center, 9);
}

function osm_getTileURL(bounds) {
    var res = this.map.getResolution();
    var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
    var y = Math.round((this.maxExtent.top - bounds.top) / (res * this.tileSize.h));
    var z = this.map.getZoom();
    var limit = Math.pow(2, z);

    if (y < 0 || y >= limit) {
	return OpenLayers.Util.getImagesLocation() + "404.png";
    } else {
	x = ((x % limit) + limit) % limit;
	return this.url + z + "/" + x + "/" + y + "." + this.type;
    }
}
