
//继承覆盖Overlay类，并重定义方法 new DeOverlayC  -- @todo要不要封装
function DeOverlayC(point, html)
{
	this._point = point;
	this._html = html;
}
//继承类
DeOverlayC.prototype = new BMap.Overlay();
DeOverlayC.prototype.initialize = function(map)
{
	this._map = map;
	var div = this._div = document.createElement("div");
	//var span = this._span = document.createElement("span");
	if (document.all)
	{
		this._div.className = 'qu';
	} else {
		this._div.setAttribute('class', 'qu');
	}

	div.innerHTML = this._html;
	div.onmouseover = function() {
		if ($(this).find(".usual").length != 0)
		{
			var objectElement = $(this).find(".usual");
			objectElement.addClass("on");
			$(this).css('z-index', '100');
			if ($(objectElement).attr('type') == 'block')
			{
				$(this).find('.taoshu').css('display', 'inline');
				//Model.block[$(objectElement).attr('blockid')] = true;
				/*
				if ($(this).find('.taoshu').html() == '')
				{
					Model.getBlockCount($(objectElement).attr('blockid'), $(this));
				} else {
					$(this).find('.taoshu').css('display', 'inline');
				}*/
			}
		}
	};

    div.onmouseout = function() {
		if ($(this).find(".usual").length != 0)
		{
			var objectElement = $(this).find(".usual");
			objectElement.removeClass("on");
			$(this).css('z-index', '-1');
			if ($(objectElement).attr('type') == 'block')
			{
				//Model.block[$(objectElement).attr('blockid')] = false;
				$(this).find('.taoshu').css('display', 'none');
			}
		}

    };

	div.onclick = function() {
		if ($(this).find(".usual").length != 0)
		{
			switch ($(this).find(".usual").attr('type'))
			{
				case 'block':
					Page.displayBlockHouse($(this).find(".usual"));
					break;
				case 'district':
					Draw.clearDraw();
					Draw.mapState = false;
					Page.displayDistrictData($(this).find(".qum").attr('district'));
					break;
				default:
			}
		} else if ($(this).find(".block").length != 0) {
			if ($(this).find(".block").attr('blockid') != undefined)
			{
				Page.displayBlockHouse($(this).find(".block"));
			}
		}

	};
	objMap.getPanes().labelPane.appendChild(div);
	return div;
}

DeOverlayC.prototype.draw = function()
{
	  var map = this._map;
	  var pixel = map.pointToOverlayPixel(this._point);
	  this._div.style.left = pixel.x  + 'px';
	  this._div.style.top  = pixel.y  - 38 + 'px';
	  this._div.style.position = "absolute";
}
