function GMiniMap(){}

GMiniMap.prototype.initialize = function(a) {
	this.orig = a;
	var b = a.ownerDocument.createElement("div");
	b.style.width = "25%";
	b.style.height = "25%";

	var self = this;
	GEvent.addListener(a,"move", function(){self.refresh()});
	GEvent.addListener(a,"zoom", function(){self.refresh()});
	
	this.div = b;
	return b;
}
	
GMiniMap.prototype.getDefaultPosition = function() {
	return new X(3,4,16);
}

GMiniMap.prototype.refresh = function() {
	if ( this.mini == null ) {
		this.mini = new GMap(this.div);
		this.mini.disableDragging();
		
		/* Apparently disabling dragging kills all 'fun' event handlers
		var self = this;
		GEvent.addListener( this.mini, "click", function(p){
			self.orig.recenterOrPanToLatLng( p );
		});*/
		
		var c = this.div.childNodes;
		c[1].style.display = 'none';
		c[2].style.display = 'none';
		
		var c = this.orig.ownerDocument.createElement("div");
		c.style.position = "absolute";
		c.style.top = "25%";
		c.style.left = "25%";
		c.style.width = "50%";
		c.style.height = "50%";
		c.style.border = "2px #000 dashed";
		c.style.zIndex = "999";
		this.div.appendChild(c);
	}
	
	if ( this.orig.getZoomLevel() > 13 )
		this.div.style.display = 'none';
	else {
		this.div.style.display = 'block';
		this.mini.centerAndZoom(
			this.orig.getCenterLatLng(),
			this.orig.getZoomLevel() + 3
		);
	}
};

