Index: lib/OpenLayers/Control/PanZoomBar.js
===================================================================
--- lib/OpenLayers/Control/PanZoomBar.js	(revisión: 10094)
+++ lib/OpenLayers/Control/PanZoomBar.js	(copia de trabajo)
@@ -47,12 +47,6 @@
     zoomBarDiv: null,
 
     /** 
-     * Property: divEvents
-     * {<OpenLayers.Events>}
-     */
-    divEvents: null,
-
-    /** 
      * APIProperty: zoomWorldIcon
      * {Boolean}
      */
@@ -91,11 +85,6 @@
 
         this._removeZoomBar();
 
-        this.map.events.un({
-            "changebaselayer": this.redraw,
-            scope: this
-        });
-
         OpenLayers.Control.PanZoom.prototype.destroy.apply(this, arguments);
 
         delete this.mouseDragStart;
@@ -110,7 +99,10 @@
      */
     setMap: function(map) {
         OpenLayers.Control.PanZoom.prototype.setMap.apply(this, arguments);
-        this.map.events.register("changebaselayer", this, this.redraw);
+        this.addListener(this.map.events,{
+            "changebaselayer": this.redraw,
+            scope: this
+        });
     },
 
     /** 
@@ -181,15 +173,20 @@
                        "absolute");
         this.slider = slider;
         
+        var zoomBarListeners = [];
+        var noClick = function (evt) {
+            OpenLayers.Event.stop(evt);
+            return false;
+        };
         this.sliderEvents = new OpenLayers.Events(this, slider, null, true,
                                             {includeXY: true});
-        this.sliderEvents.on({
+        zoomBarListeners.push(this.addListener(this.sliderEvents,{
             "mousedown": this.zoomBarDown,
             "mousemove": this.zoomBarDrag,
             "mouseup": this.zoomBarUp,
-            "dblclick": this.doubleClick,
-            "click": this.doubleClick
-        });
+            "dblclick": noClick,
+            "click": noClick
+        }));
         
         var sz = new OpenLayers.Size();
         sz.h = this.zoomStopHeight * this.map.getNumZoomLevels();
@@ -214,21 +211,31 @@
         
         this.zoombarDiv = div;
         
-        this.divEvents = new OpenLayers.Events(this, div, null, true, 
-                                                {includeXY: true});
-        this.divEvents.on({
-            "mousedown": this.divClick,
-            "mousemove": this.passEventToSlider,
-            "dblclick": this.doubleClick,
-            "click": this.doubleClick
-        });
+        zoomBarListeners.push(this.addListener(
+            new OpenLayers.Events(this, div, null, true, {includeXY: true}),
+            {
+                "mousedown": this.divClick,
+                "mousemove": this.passEventToSlider,
+                "dblclick": noClick,
+                "click": noClick
+            }
+        ));
         
         this.div.appendChild(div);
 
         this.startTop = parseInt(div.style.top);
         this.div.appendChild(slider);
 
-        this.map.events.register("zoomend", this, this.moveZoomBar);
+        zoomBarListeners.push(this.addListener(this.map.events,{
+            "zoomend": function() {
+                var newTop = 
+                    ((this.map.getNumZoomLevels()-1) - this.map.getZoom()) * 
+                    this.zoomStopHeight + this.startTop + 1;
+                this.slider.style.top = newTop + "px";
+            },  
+            scope:this
+        }));
+        this._zoomBarListeners = zoomBarListeners;
 
         centered = centered.add(0, 
             this.zoomStopHeight * this.map.getNumZoomLevels());
@@ -239,29 +246,13 @@
      * Method: _removeZoomBar
      */
     _removeZoomBar: function() {
-        this.sliderEvents.un({
-            "mousedown": this.zoomBarDown,
-            "mousemove": this.zoomBarDrag,
-            "mouseup": this.zoomBarUp,
-            "dblclick": this.doubleClick,
-            "click": this.doubleClick
-        });
-        this.sliderEvents.destroy();
-
-        this.divEvents.un({
-            "mousedown": this.divClick,
-            "mousemove": this.passEventToSlider,
-            "dblclick": this.doubleClick,
-            "click": this.doubleClick
-        });
-        this.divEvents.destroy();
+        this.removeListeners(this._zoomBarListeners);
+        this._zoomBarListeners = null;
         
         this.div.removeChild(this.zoombarDiv);
         this.zoombarDiv = null;
         this.div.removeChild(this.slider);
         this.slider = null;
-        
-        this.map.events.unregister("zoomend", this, this.moveZoomBar);
     },
     
     /**
@@ -379,16 +370,5 @@
         }
     },
     
-    /*
-    * Method: moveZoomBar
-    * Change the location of the slider to match the current zoom level.
-    */
-    moveZoomBar:function() {
-        var newTop = 
-            ((this.map.getNumZoomLevels()-1) - this.map.getZoom()) * 
-            this.zoomStopHeight + this.startTop + 1;
-        this.slider.style.top = newTop + "px";
-    },    
-    
     CLASS_NAME: "OpenLayers.Control.PanZoomBar"
 });
