function loadUserMap(ort, branche, abc, search_user){
    

    var markers = new Array();
    var points = Array();
    var mapdiv = document.getElementById("usermap");
    var map;
    var poly;
    var count = 0;
    
    if (tiefe == 1) var icon_url = "../core/module/user_list/img/";
    else var icon_url = "core/module/user_list/img/";
    
    var tooltip;
    var lineColor = "#00519e";
    var fillColor = "#335599";
    var lineWeight = 5;
    var lineOpacity = .6;
    var fillOpacity = .2;
    
    map = new GMap2(mapdiv);
   
    geocoder = new GClientGeocoder();
    
    if (geocoder) 
    {
        geocoder.getLatLng("Hameln, Deutschland",
            function(point){
                if (point){
                        map.setCenter(point, 9);
                }
            }
        );
    }
    
    // Load initial map and a bunch of controls
    //map.addControl(new GLargeMapControl()); // Zoom control
    map.addControl(new GScaleControl()); // Scale bar
    map.addControl(new GOverviewMapControl()); // Scale bar

    map.setUIToDefault();
    
    //map.enableScrollWheelZoom();
    //map.addMapType(G_PHYSICAL_MAP);
    map.setMapType(G_PHYSICAL_MAP);
    
    /*var hierarchy = new GHierarchicalMapTypeControl();
    hierarchy.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, "Labels", true);
    map.addControl(hierarchy);*/

    map.disableDoubleClickZoom();
    
    //neues icon generieren
    var icon = new GIcon();
    icon.image = icon_url +"point.png";
    addIcon(icon);
    
    var markergruppe = Array();
    
    loadmarker();
    
    function loadmarker()
    {
        
        var url = 'target=user_list&log=1&_k=adu&loadmarker=1';
        
        if (ort != "") url += '&ort='+ ort;
        if (branche) url += '&branche='+ branche;
        if (abc) url += '&abc='+ abc;
        if (search_user) url += '&search_user='+ search_user;
        
        
        
        $.ajax({
                    url: coreurl + 'httprequest.php',
                    type: 'POST',
                    data: url,
                    success: function(result){
                            
                            var splitter = result.split("\n");
                            
                            for (i = 0; i < splitter.length; i++){
                            
                                if (splitter[i]){
                                    
                                    var split2 =  splitter[i].split(";");
                                    
                                    var id_user = split2[0];
                                    var map_coords = split2[1];
                                    var address = split2[2];
                                    
                                    showAddress(address, id_user, map_coords);
                                }
                            }                          
                    },
                    error: function(result){
                            
                            //alert("Fehler beim Laden")
                    }
        });
    }
    
    
    $('#adresssearchform').submit(function() {
            
            var adresse  = $('#searchadress').val();
            
            if (geocoder) 
            {
                geocoder.getLatLng('Deutschland, '+adresse,
                    function(point){
                        if (point){
                            
                            map.setCenter(point, 13);
                        }
                    }
                );
            }
            
            return false;
            
    });
    
    var htmldata = Array();
    
    function showAddress(address, id_user, map_coords) {
        
        ico = "marker";
        var icon = new GIcon();
        icon.image = icon_url + ico +".png";
            
        icon.iconSize = new GSize(20, 20);
        icon.iconAnchor = new GPoint(10, 20);
        icon.infoWindowAnchor = new GPoint(5, 1);
        
        
        if (map_coords != ""){
            
            var coords_arr = map_coords.split("|");
            var str_coords = new GLatLng(parseFloat(coords_arr[0]), parseFloat(coords_arr[1]));
           
            var marker = new GMarker(str_coords, {icon:icon, draggable: false} );
            map.addOverlay(marker);
            
            GEvent.addListener(marker, 'click', function() {
                
                getuserhtml(marker, id_user);
            });
        }
        
        /*
        else
        {
            geocoder.getLatLng(address,
            function(point) {
            
                if (point) {
                
                    var marker = new GMarker(point, {icon:icon, draggable: false} );
                    map.addOverlay(marker);
                    
                    //markergruppe[type].push(marker);
                    
                    GEvent.addListener(marker, 'click', function() {
                        
                        getuserhtml(marker, id_user);
                    });
                
                }
              }
            );
        }
        */
      
    }
    
    function getuserhtml(marker, id_user)
    {
        $.ajax({
                    url: coreurl + 'httprequest.php',
                    type: 'POST',
                    data: 'target=user_list&log=1&_k=adu&loaduser='+id_user ,
                    success: function(result){
                            
                        marker.openInfoWindowHtml(result);
                    },
                    error: function(result){
                            
                            alert("Fehler beim Laden")
                    }
        });
    }
    
    function addIcon(icon) { // Add icon attributes
    
        icon.shadow = icon_url + "schatten.png";
        icon.iconSize = new GSize(8, 8);
        icon.shadowSize = new GSize(12, 12);
        icon.iconAnchor = new GPoint(6, 10);
        icon.infoWindowAnchor = new GPoint(5, 1);
    }
    
    
}