Skobbler = {};
Skobbler.Popup =
  OpenLayers.Class(OpenLayers.Popup.Anchored, {
           /*contentDisplayClass: "olAnchoredPopupContent_skobbler",
					 'autoSize': true,
           'panMapIfOutOfView': false

       } {*/
	 contentDisplayClass: "olAnchoredPopupContent_skobbler",
     'autoSize': true,
	 initialize:function(id, lonlat, contentSize, contentHTML, anchor, closeBox, 
                        closeBoxCallback) {
        OpenLayers.Popup.Anchored.prototype.initialize.apply(this, arguments);
		
		this.contentDiv.style.position = "absolute";
		
    },

	show: function(){
		OpenLayers.Popup.Anchored.prototype.show.apply(this, arguments);
	},
	distroy: function() {
		OpenLayers.Popup.Anchored.prototype.distroy.apply(this, arguments);
	},

	 moveTo: function(px) {
		var newArguments = new Array(px);
        OpenLayers.Popup.Anchored.prototype.moveTo.apply(this, newArguments);
	 },
	 
	 setSize:function(contentSize) {
        OpenLayers.Popup.prototype.setSize.apply(this, arguments);
		var arrow = $(this.contentDiv).down('.popupArrow');
		if(typeof arrow == "undefined") return;
		var top = 0;
		var left = 0;
		var size = this.size;
		switch(this.relativePosition) {
			case "tr":
				top = size.h - 3;
				left += 15;
				break;
			case "tl":
				top = size.h - 3;
				left = size.w - 20;
				break;
			case "br":
				arrow.className = "pointerArrowUp popupArrow";
				left += 15;
				top -= 9;
				break;
			case "bl":
				arrow.className = "pointerArrowUp popupArrow";
				left = size.w - 20;
				top -= 9;
				break;
		}

		arrow.setStyle({
				position:"absolute",
				left: left + "px",
				top:  top + "px"
				
			});
		 
	 }
});
  
