// Position und Zoomstufe der Karte
var lon = 8.6109639;
var lat = 49.7273731;
var zoom = 15;

var map_div = 'map';
function drawmap(){
            map = new OpenLayers.Map(map_div);
            layer = new OpenLayers.Layer.OSM();
                
            map.addLayer(layer);
            map.setCenter(new OpenLayers.LonLat(0, 0), 0);

            var fromProjection = new OpenLayers.Projection("EPSG:4326");   // Transform from WGS 1984
            var toProjection   = new OpenLayers.Projection("EPSG:900913");
            var position       = new OpenLayers.LonLat(lon,lat).transform( fromProjection, toProjection);
            
            var markers = new OpenLayers.Layer.Markers( "Markers" );
            map.addLayer(markers);

            var size = new OpenLayers.Size(25,40);
            var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
            var icon = new OpenLayers.Icon('http://meetaprogrammer.com/assets/leaflet/blue-marker-icon.png',size,offset);
            var halfIcon = icon.clone();

            marker = new OpenLayers.Marker(position,icon.clone());
            marker.setOpacity(1);
            marker.events.register('mousedown', marker, function(evt) { alert(this.icon.url); OpenLayers.Event.stop(evt); });
            markers.addMarker(marker); 
            
            //map.addControl(new OpenLayers.Control.LayerSwitcher());
            //map.zoomToMaxExtent();
            map.setCenter(position, zoom );
            halfIcon.setOpacity(0.5);
            
            $('#'+map_div).show();
        }