Index: trunk/src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 2191)
+++ trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 2192)
@@ -63,5 +63,4 @@
  */
 public class MapView extends NavigatableComponent implements PropertyChangeListener {
-
 
     /**
@@ -156,9 +155,10 @@
             playHeadMarker = PlayHeadMarker.create();
         }
-        int pos = layers.size();
-        while(pos > 0 && layers.get(pos-1).background) {
-            --pos;
-        }
-        layers.add(pos, layer);
+
+        if (layer.isBackgroundLayer() || layers.isEmpty()) {
+            layers.add(layer);
+        } else {
+            layers.add(0, layer);
+        }
 
         for (Layer.LayerChangeListener l : Layer.listeners) {
Index: trunk/src/org/openstreetmap/josm/gui/layer/Layer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/Layer.java	(revision 2191)
+++ trunk/src/org/openstreetmap/josm/gui/layer/Layer.java	(revision 2192)
@@ -71,6 +71,7 @@
     /**
      * The layer should be handled as a background layer in automatic handling
-     */
-    public boolean background = false;
+     * 
+     */
+    private boolean background = false;
 
     /**
@@ -170,5 +171,83 @@
     }
 
-
+    /**
+     * Replies true if this layer is a background layer
+     * 
+     * @return true if this layer is a background layer
+     */
+    public boolean isBackgroundLayer() {
+        return background;
+    }
+
+    /**
+     * Sets whether this layer is a background layer
+     * 
+     * @param background true, if this layer is a background layer
+     */
+    public void setBackgroundLayer(boolean background) {
+        this.background = background;
+    }
+
+    /**
+     * Sets the visibility of this layer. Emits property change event for
+     * property {@see #VISIBLE_PROP}.
+     * 
+     * @param visible true, if the layer is visible; false, otherwise.
+     */
+    public void setVisible(boolean visible) {
+        boolean oldValue = this.visible;
+        this.visible  = visible;
+        if (oldValue != this.visible) {
+            fireVisibleChanged(oldValue, this.visible);
+        }
+    }
+
+    /**
+     * Replies true if this layer is visible. False, otherwise.
+     * @return  true if this layer is visible. False, otherwise.
+     */
+    public boolean isVisible() {
+        return visible;
+    }
+
+    /**
+     * Toggles the visibility state of this layer.
+     */
+    public void toggleVisible() {
+        setVisible(!isVisible());
+    }
+
+    /**
+     * Adds a {@see PropertyChangeListener}
+     * 
+     * @param listener the listener
+     */
+    public void addPropertyChangeListener(PropertyChangeListener listener) {
+        propertyChangeSupport.addPropertyChangeListener(listener);
+    }
+
+    /**
+     * Removes a {@see PropertyChangeListener}
+     * 
+     * @param listener the listener
+     */
+    public void removePropertyChangeListener(PropertyChangeListener listener) {
+        propertyChangeSupport.removePropertyChangeListener(listener);
+    }
+
+    /**
+     * fires a property change for the property {@see #VISIBLE_PROP}
+     * 
+     * @param oldValue the old value
+     * @param newValue the new value
+     */
+    protected void fireVisibleChanged(boolean oldValue, boolean newValue) {
+        propertyChangeSupport.firePropertyChange(VISIBLE_PROP, oldValue, newValue);
+    }
+
+    /**
+     * The action to save a layer
+     * 
+     */
     public static class LayerSaveAction extends AbstractAction {
         private Layer layer;
@@ -183,5 +262,4 @@
         public void actionPerformed(ActionEvent e) {
             new SaveAction().doSave(layer);
-
         }
     }
@@ -216,60 +294,3 @@
         }
     }
-
-    /**
-     * Sets the visibility of this layer. Emits property change event for
-     * property {@see #VISIBLE_PROP}.
-     * 
-     * @param visible true, if the layer is visible; false, otherwise.
-     */
-    public void setVisible(boolean visible) {
-        boolean oldValue = this.visible;
-        this.visible  = visible;
-        if (oldValue != this.visible) {
-            fireVisibleChanged(oldValue, this.visible);
-        }
-    }
-
-    /**
-     * Replies true if this layer is visible. False, otherwise.
-     * @return  true if this layer is visible. False, otherwise.
-     */
-    public boolean isVisible() {
-        return visible;
-    }
-
-    /**
-     * Toggles the visibility state of this layer.
-     */
-    public void toggleVisible() {
-        setVisible(!isVisible());
-    }
-
-    /**
-     * Adds a {@see PropertyChangeListener}
-     * 
-     * @param listener the listener
-     */
-    public void addPropertyChangeListener(PropertyChangeListener listener) {
-        propertyChangeSupport.addPropertyChangeListener(listener);
-    }
-
-    /**
-     * Removes a {@see PropertyChangeListener}
-     * 
-     * @param listener the listener
-     */
-    public void removePropertyChangeListener(PropertyChangeListener listener) {
-        propertyChangeSupport.removePropertyChangeListener(listener);
-    }
-
-    /**
-     * fires a property change for the property {@see #VISIBLE_PROP}
-     * 
-     * @param oldValue the old value
-     * @param newValue the new value
-     */
-    protected void fireVisibleChanged(boolean oldValue, boolean newValue) {
-        propertyChangeSupport.firePropertyChange(VISIBLE_PROP, oldValue, newValue);
-    }
 }
