docs: function (type, obj, func, priority) {
          if (type in OpenLayers.Events && !this.extensions[type]) {
              this.extensions[type] = new OpenLayers.Events[type](this);
          }
          if (func != null) {
              if (obj == null)  {
                  obj = this.object;
              }
              var listeners = this.listeners[type];
              if (!listeners) {
                  listeners = [];
                  this.listeners[type] = listeners;
                  this.extensionCount[type] = 0;
              }
              var listener = {obj: obj, func: func};
              if (priority) {
                  listeners.splice(this.extensionCount[type], 0, listener);
                  if (typeof priority === "object" && priority.extension) {
                      this.extensionCount[type]++;
                  }
              } else {
                  listeners.push(listener);
              }
          }
      }