function MarkObject(oMapObj, sName, nSize, nZIndex)
{
	var eMark = document.createElement("IMG");
	eMark.style.position = "absolute";
	eMark.style.left = eMark.style.top = "-100px";
	eMark.style.height = eMark.style.width = String(nSize) + "px";
	eMark.style.visibility = "hidden";
	eMark.src = "/gfx/DVIcons/" + sName + ".gif";
	eMark.style.zIndex = String(nZIndex);

	eMark.bPreserve = true;
	eMark.obj = this;
	eMark.oMO = oMapObj;

	this.node = eMark;
	this.oMO = oMapObj;
	this.nOffset = nSize/2;
	this.nLat = this.nLon = this.nX = this.nY = null;
	this.sName = sName;
}

MarkObject.prototype.show = function(bShow)	{ this.node.style.visibility = bShow?"visible":"hidden"; }
MarkObject.prototype.clear = function () { this.nLat=this.nLon=this.nX=this.nY=null; this.show(false); }
MarkObject.prototype.getSrc = function() { return this.node.src; }

MarkObject.prototype.setMouseOverAndOut = function(fMouseOver, fMouseOut)
{
	this.node.onmouseover = (fMouseOver) ? fMouseOver : null;
	this.node.onmouseout = (fMouseOut) ? fMouseOut : null;
}

MarkObject.prototype.move = function(nX, nY)
{
	this.setMouseOverAndOut();
	if (this.oMO.isPointInMargins(nX, nY))
	{
		this.nX = nX;
		this.nY = nY;
		this.node.style.left = String(nX - this.nOffset) + "px";
		this.node.style.top = String(nY - this.nOffset) + "px";
		this.show(true);
	}
	else
	{
		this.nX = this.nY = null;
		this.show(false);
	}
}

MarkObject.prototype.moveLatLon = function(nLat, nLon)
{
	this.nLat = nLat;
	this.nLon = nLon;

	var nX = this.oMO.LonToX(nLon);
	var nY = this.oMO.LatToY(nLat);

	this.move(nX, nY);
}

MarkObject.prototype.display = function()
{
	if (this.nLat && this.nLon)
		this.moveLatLon(this.nLat, this.nLon);
}

