Index: /applications/editors/josm/plugins/czechaddress/build.xml
===================================================================
--- /applications/editors/josm/plugins/czechaddress/build.xml	(revision 22811)
+++ /applications/editors/josm/plugins/czechaddress/build.xml	(revision 22812)
@@ -92,4 +92,5 @@
             <jvmarg value="-Xdebug"/>
             <jvmarg value="-ea"/>
+            <jvmarg value="-Djava.net.useSystemProxies=true"/>
             <classpath>
                 <pathelement location="${plugin.build.dir}"/>
Index: /applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java
===================================================================
--- /applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java	(revision 22811)
+++ /applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java	(revision 22812)
@@ -33,4 +33,8 @@
     protected ElementWithStreets selectedElement;
     protected ArrayList<ItemListener> listeners = new ArrayList<ItemListener>();
+    int regionHlIndex, vitociHlIndex, suburbHlIndex;
+    protected ArrayList<AddressElement> hlRegions = new ArrayList<AddressElement>();
+    protected ArrayList<AddressElement> hlViToCis = new ArrayList<AddressElement>();
+    protected ArrayList<AddressElement> hlSuburbs = new ArrayList<AddressElement>();
 
 
@@ -52,4 +56,5 @@
         setContent(mainPanel);
         setButtonIcons(new String[] {"ok.png", "cancel.png"});
+        setDefaultButton(1);
         setupDialog();
 
@@ -58,20 +63,20 @@
         suburbComboBox.setRenderer(new SuburbRenderer());
 
-        oblastComboBox.setModel(new DefaultComboBoxModel(
-                Database.getInstance().regions.toArray()));
-
-        try {
-            autodetectLocation();
-        } catch (Exception e) {}
-        //oblastComboBoxItemStateChanged(null);
+        initLocationHints();
+
+        DefaultComboBoxModel regions = new DefaultComboBoxModel(Database.getInstance().regions.toArray());
+        regionHlIndex = reshuffleListItems(regions, hlRegions);
+        oblastComboBox.setModel(regions);
+        oblastComboBox.setSelectedItem(regions.getElementAt(0));
+
+        oblastComboBoxItemStateChanged(null);
     }
 
     /**
-     * Hardly ever working method for autodetecting the current location.
+     * Guess location name from the map and put all matches to the top of the
+     * list.
      *
-     * @deprecated
      */
-    @Deprecated
-	private void autodetectLocation() {
+	private void initLocationHints() {
         boolean assertions = false;
         assert  assertions = true;
@@ -79,8 +84,4 @@
         OsmPrimitive bestFit = null;
         double bestLen = 0;
-
-        // TODO: center se počítá jako střed stažené oblasti. Měl by to však
-        // být střed obrazovky... Jen vědět, jak získat souřadnici středu
-        // obrazovky.
 
         BoundingXYVisitor visitor = new BoundingXYVisitor();
@@ -96,5 +97,5 @@
 
         try {
-            center = Main.proj.eastNorth2latlon(visitor.getBounds().getCenter());
+            center = Main.proj.eastNorth2latlon(Main.map.mapView.getCenter());
         } catch (Exception e) {
             System.err.println("AUTO: No bounds to determine autolocation.");
@@ -143,22 +144,17 @@
                 for (ViToCi obec : oblast.getViToCis()) {
                     if (!bestFit.get("place").equals("suburb")) {
-                        if (obec.getName().toUpperCase().equals(bestFit.get("name").toUpperCase())) {
-                            oblastComboBox.setSelectedItem(oblast);
-                            vitociComboBox.setSelectedItem(obec);
-                            for (Suburb castObce : obec.getSuburbs()) {
-                                if (castObce.getName().toUpperCase().equals(bestFit.get("name").toUpperCase())) {
-                                    suburbComboBox.setSelectedItem(castObce);
-                                    break;
-                                }
-                            }
-                            break;
+                        if (obec.getName().equalsIgnoreCase(bestFit.get("name"))) {
+                            hlRegions.add(oblast);
+                            hlViToCis.add(obec);
+                            for (Suburb castObce : obec.getSuburbs())
+                                if (castObce.getName().equalsIgnoreCase(bestFit.get("name")))
+                                    hlSuburbs.add(castObce);
                         }
                     } else {
                         for (Suburb castObce : obec.getSuburbs()) {
-                            if (castObce.getName().toUpperCase().equals(bestFit.get("name").toUpperCase())) {
-                                oblastComboBox.setSelectedItem(oblast);
-                                vitociComboBox.setSelectedItem(obec);
-                                suburbComboBox.setSelectedItem(castObce);
-                                break;
+                            if (castObce.getName().equalsIgnoreCase(bestFit.get("name"))) {
+                                hlRegions.add(oblast);
+                                hlViToCis.add(obec);
+                                hlSuburbs.add(castObce);
                             }
                         }
@@ -167,4 +163,25 @@
             }
         }
+    }
+
+    /**
+    * Reshuffle items in combo box list, put those in hlList to the
+    * beginning, return number of moved items.
+    */
+
+    private int reshuffleListItems(DefaultComboBoxModel list, final ArrayList<AddressElement> hlList) {
+        int curHlIndex = 0;
+
+        for (int i = 0; i < list.getSize(); i++) 
+            for (int j = 0; j < hlList.size(); j++) {
+                Object t = list.getElementAt(i);
+                if (t == hlList.get(j)) {
+                    list.removeElementAt(i);
+                    list.insertElementAt(t, curHlIndex++);
+                    break;
+                }
+            }
+
+        return curHlIndex;
     }
 
@@ -278,5 +295,8 @@
         if (oblast == null) return;
 
-        vitociComboBox.setModel(new DefaultComboBoxModel(oblast.getViToCis().toArray()));
+        DefaultComboBoxModel vitocis = new DefaultComboBoxModel(oblast.getViToCis().toArray());
+        vitociHlIndex = reshuffleListItems(vitocis, hlViToCis);
+        vitociComboBox.setModel(vitocis);
+        vitociComboBox.setSelectedItem(vitocis.getElementAt(0));
         vitociComboBox.setEnabled(vitociComboBox.getModel().getSize() > 1);
         vitociComboBoxItemStateChanged(null);
@@ -293,5 +313,8 @@
                 suburbs[i] = obec.getSuburbs().get(i);
             suburbs[obec.getSuburbs().size()] = obec;
-            suburbComboBox.setModel(new DefaultComboBoxModel(suburbs));
+            DefaultComboBoxModel suburbsList = new DefaultComboBoxModel(suburbs);
+            suburbHlIndex = reshuffleListItems(suburbsList, hlSuburbs);
+            suburbComboBox.setModel(suburbsList);
+            suburbComboBox.setSelectedItem(suburbsList.getElementAt(0));
         } else
             suburbComboBox.setModel(new DefaultComboBoxModel());
@@ -345,4 +368,10 @@
                 setText(((AddressElement) value).getName());
 
+            if ((value instanceof Region && index < regionHlIndex) ||
+                (value instanceof ViToCi && index < vitociHlIndex))
+                setFont(getFont().deriveFont(Font.BOLD));
+            else
+                setFont(getFont().deriveFont(Font.PLAIN));
+
             return c;
         }
@@ -360,6 +389,8 @@
 //                setText(((ViToCi) value).getName() + ", všechny části [experimentální]");
                 setText("všechny části obce [experimentální]");
-            } else
-                setFont(getFont().deriveFont(Font.PLAIN));
+            } else if (index < suburbHlIndex)
+                    setFont(getFont().deriveFont(Font.BOLD));
+                else
+                    setFont(getFont().deriveFont(Font.PLAIN));
 
             return c;
