Index: /applications/editors/josm/plugins/utilsplugin2/build.xml
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/build.xml	(revision 26693)
+++ /applications/editors/josm/plugins/utilsplugin2/build.xml	(revision 26694)
@@ -30,5 +30,5 @@
 <project name="utilsplugin2" default="dist" basedir=".">
     <!-- enter the SVN commit message -->
-    <property name="commit.message" value="Utilsplugin2: republish with JAR and JOSM>=4399"/>
+    <property name="commit.message" value="Utilsplugin2: opening URL works without selected object"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
     <property name="plugin.main.version" value="4399"/>
Index: /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/ChooseURLAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/ChooseURLAction.java	(revision 26693)
+++ /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/ChooseURLAction.java	(revision 26694)
@@ -4,6 +4,9 @@
 import java.awt.event.ItemEvent;
 import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.swing.JComboBox;
 import javax.swing.JPanel;
+import javax.swing.event.ListSelectionEvent;
 import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.tools.GBC;
@@ -11,8 +14,13 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.ItemListener;
+import java.awt.event.KeyEvent;
 import javax.swing.JCheckBox;
 import javax.swing.JLabel;
+import javax.swing.JList;
 import javax.swing.JTextField;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.ListSelectionListener;
 import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.gui.SelectionManager;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
@@ -26,5 +34,5 @@
     @Override
     public void actionPerformed(ActionEvent e) {
-       showConfigDialog();
+       showConfigDialog(false);
     }
 
@@ -38,5 +46,5 @@
     }
         
-    public static void showConfigDialog() {
+    public static void showConfigDialog(final boolean fast) {
         JPanel all = new JPanel();
         GridBagLayout layout = new GridBagLayout();
@@ -54,17 +62,21 @@
         }
         final JLabel label1=new JLabel(tr("Please select one of custom URLs (configured in Preferences)"));
-        final JComboBox combo1=new JComboBox(names);
+        final JList list1=new JList(names);
         final JTextField editField=new JTextField();
         final JCheckBox check1=new JCheckBox(tr("Ask every time"));
         
-        
-        combo1.addItemListener(new ItemListener() {
+        final ExtendedDialog dialog = new ExtendedDialog(Main.parent,
+                tr("Configure custom URL"),
+                new String[] {tr("OK"),tr("Cancel"),}
+        );
+        list1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        list1.addListSelectionListener(new ListSelectionListener() {
             @Override
-            public void itemStateChanged(ItemEvent e) {
-                int idx=combo1.getSelectedIndex();
+            public void valueChanged(ListSelectionEvent e) {
+                int idx=list1.getSelectedIndex();
                 if (idx>=0) editField.setText(vals[idx]);
             }
         });
-        combo1.setSelectedIndex(idxToSelect);
+        list1.setSelectedIndex(idxToSelect);
         check1.setSelected(Main.pref.getBoolean("utilsplugin2.askurl",false));
         
@@ -72,12 +84,9 @@
         
         all.add(label1,GBC.eop().fill(GBC.HORIZONTAL).insets(15,5,15,0));
-        all.add(combo1,GBC.eop().fill(GBC.HORIZONTAL).insets(5,5,0,0));
+        all.add(list1,GBC.eop().fill(GBC.HORIZONTAL).insets(5,5,0,0));
         all.add(editField,GBC.eop().fill(GBC.HORIZONTAL).insets(5,5,0,0));
         all.add(check1,GBC.eop().fill(GBC.HORIZONTAL).insets(5,5,0,0));
         
-        ExtendedDialog dialog = new ExtendedDialog(Main.parent,
-                tr("Configure custom URL"),
-                new String[] {tr("OK"),tr("Cancel"),}
-        );
+        
         dialog.setContent(all, false);
         dialog.setButtonIcons(new String[] {"ok.png","cancel.png",});
@@ -85,5 +94,5 @@
         dialog.showDialog();
         
-        int idx = combo1.getSelectedIndex();
+        int idx = list1.getSelectedIndex();
         if (dialog.getValue() ==1 && idx>=0) {
            Main.pref.put("utilsplugin2.customurl", vals[idx]);
Index: /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/OpenPageAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/OpenPageAction.java	(revision 26693)
+++ /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/OpenPageAction.java	(revision 26694)
@@ -2,5 +2,4 @@
 package utilsplugin2;
 
-import java.awt.GridBagLayout;
 import java.io.UnsupportedEncodingException;
 import static org.openstreetmap.josm.tools.I18n.tr;
@@ -12,22 +11,14 @@
 import java.util.Collection;
 
-import java.util.List;
 import java.util.regex.Matcher;
 
 import java.util.regex.Pattern;
-import javax.swing.BorderFactory;
-import javax.swing.JComboBox;
 import javax.swing.JOptionPane;
 
-import javax.swing.JPanel;
-import javax.swing.border.EtchedBorder;
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
-import org.openstreetmap.josm.gui.ExtendedDialog;
-import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
-import org.openstreetmap.josm.gui.widgets.HtmlPanel;
-import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.OpenBrowser;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -54,17 +45,15 @@
         Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected();
         OsmPrimitive p=null;
-        if (sel.size()==1) {
+        if (sel.size()>=1) {
             p=sel.iterator().next();
-        } else {
-            JOptionPane.showMessageDialog(
-                    Main.parent,
-                    tr("Please select one element to open custom URL for it. You can choose the URL in Preferences, Utils tab."),
-                    tr("Information"),
-                    JOptionPane.INFORMATION_MESSAGE
-            );
-            return;
         }
+        
         if (Main.pref.getBoolean("utilsplugin2.askurl",false)==true) 
-            ChooseURLAction.showConfigDialog();
+            ChooseURLAction.showConfigDialog(true);
+        
+        //lat = p.getBBox().getTopLeft().lat();
+        //lon = p.getBBox().getTopLeft().lon();
+        LatLon center = Main.map.mapView.getLatLon(Main.map.mapView.getWidth()/2, Main.map.mapView.getHeight()/2);
+                
         
         String addr = Main.pref.get("utilsplugin2.customurl", defaultURL);
@@ -76,17 +65,19 @@
         try {
         while (m.find()) {
-                key=m.group(1);
+                key=m.group(1); val=null;                
                 if (key.equals("#id")) {
-                    val=Long.toString(p.getId());
+                    if (p!=null) val=Long.toString(p.getId()); ;
                 } else if (key.equals("#type")) {
-                    val = OsmPrimitiveType.from(p).getAPIName();
+                    if (p!=null) val = OsmPrimitiveType.from(p).getAPIName(); ;
                 } else if (key.equals("#lat")) {
-                    val = Double.toString(p.getBBox().getTopLeft().lat());
+                    val = Double.toString(center.lat());
                 } else if (key.equals("#lon")) {
-                    val = Double.toString(p.getBBox().getTopLeft().lon());
+                    val = Double.toString(center.lon());
                 }
                 else {
-                    val =p.get(key);
-                    if (val!=null) val =URLEncoder.encode(p.get(key), "UTF-8"); else return;
+                    if (p!=null) {
+                        val =p.get(key);
+                        if (val!=null) val =URLEncoder.encode(p.get(key), "UTF-8"); else return;
+                    }
                 }
                 keys[i]=m.group();
@@ -118,12 +109,8 @@
             setEnabled(false);
         } else {
-            updateEnabledState(getCurrentDataSet().getSelected());
+            setEnabled(true);
         }
     }
 
-    @Override
-    protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
-        setEnabled(selection != null );
-    }
-
+    
 }
Index: /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/selection/SelectAllInsideAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/selection/SelectAllInsideAction.java	(revision 26693)
+++ /applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/selection/SelectAllInsideAction.java	(revision 26694)
@@ -39,7 +39,4 @@
         Set<Relation> selectedRels = OsmPrimitive.getFilteredSet(getCurrentDataSet().getSelected(), Relation.class);
 
-        for (Way w: selectedWays) {
-            if (!w.isClosed()) selectedWays.remove(w);
-        }
         for (Relation r: selectedRels) {
             if (!r.isMultipolygon()) selectedRels.remove(r);
