// JavaScript Document
	
	function mBubble(map,map_div_id) {
		this.map = map;
		this.map_div_id = map_div_id;
		this.visible = false;
		this.canHide = true;
		this.oldCenter = 0;
	}

	mBubble.prototype = new GOverlay();

	mBubble.prototype.initialize = function(map) {
		var div = document.createElement("div");
		//map.getPane(G_MAP_MARKER_MOUSE_TARGET_PANE).appendChild(div);
		document.getElementById(this.map_div_id).appendChild(div);
		this.div = div;
		this.hide();
	}

	mBubble.prototype.openOnMap = function(css, point, x, y, html) {
		if ( this.canHide ) {
			this.offsetX = x;
			this.offsetY = y;
			this.point = point;
			
			this.div.className = css;
			this.div.innerHTML = html;
			this.div.style.zIndex = 999; //GOverlay.getZIndex(this.point.lat());

			this.show();
			this.redraw(true);
		}
	}

	mBubble.prototype.openOnMarker = function(css,marker,x,y,html) {
		if ( this.canHide ) {
			this.openOnMap(css,marker.getPoint(), x, y, html);
		}
	}


	mBubble.prototype.redraw = function(force) {
		if (!this.visible) {return;}
		var cloc = this.map.fromContainerPixelToLatLng(new GPoint(0,0), true);
		var clocPixel = this.map.fromLatLngToDivPixel(cloc);
		
		var p = map.fromLatLngToDivPixel(this.point);
		this.div.style.left   = ( p.x - clocPixel.x + this.offsetX  ) + "px";
		this.div.style.top = ( p.y - clocPixel.y + this.offsetY ) + "px";
	}

	mBubble.prototype.remove = function() {
		this.canHide = true;
		this.hide();
		this.div.parentNode.removeChild(this.div);
	}

	mBubble.prototype.copy = function() { return new EWindow(this.map, this.css);
	}

	mBubble.prototype.show = function() {
		this.div.style.display = '';
		this.visible = true;
	}

	mBubble.prototype.hide = function() {
		if ( this.canHide ) {
			this.div.style.display = 'none';
			this.visible = false;
		}
	}

	mBubble.prototype.close = function() {
		this.canHide = true;
		this.hide();
	}

	mBubble.prototype.closeCenter = function() {
		this.close();
		map.panTo( this.oldCenter );
	}

	mBubble.prototype.isHidden = function() {return !this.visible;}
	mBubble.prototype.supportsHide = function() {return true;}


