function HomeMarker(image, activeIcon, compIcon, point, zindex)
{
		this.icon = image;
		this.activeIcon = activeIcon;
		this.compIcon = compIcon;
		this.point = point;
		this.bounds = null;
		
		this.state = 0;
        this.zindex = zindex;
}

HomeMarker.prototype.initialize=function(a)
{
		this.map=a;
		if(_isIE == false)
		{
			this.div=this.map.getPane(G_MAP_MARKER_PANE).ownerDocument.createElement("img");
			this.div.src = this.icon.image;
			this.div.setAttribute("border", "0");
			
		}
		else
		{
			this.div=this.map.getPane(G_MAP_MARKER_PANE).ownerDocument.createElement("div");
			this.div.style.width = this.icon.iconSize.width + "px";
			this.div.style.height = this.icon.iconSize.height + "px";
			this.div.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.icon.image + "',sizingMethod='scale')";
			
		}
		this.div.style.display='block';
		this.div.style.position="absolute";
				
		this.div.style.border="0";
		this.div.style.padding="0";
		this.div.style.margin="0";
		this.div.style.cursor="pointer";
        this.div.style.zIndex = this.zindex;
		
		
		a.getPane(G_MAP_MARKER_PANE).appendChild(this.div);
		this.bounds = this.map.getBounds();
		
		this.div.oncontextmenu=function(){return false};
		GEvent.bindDom(this.div,"mousedown",this,this.onMouseDown);
		GEvent.bindDom(this.div,"mouseover",this,this.onMouseOver);
		GEvent.bindDom(this.div,"mouseout",this,this.onMouseOut);
};

		
HomeMarker.prototype.redraw=function(force)
{
	//debugger;
	if(!force)return;
	var mapPoint = this.map.fromLatLngToDivPixel(this.point)
	
	this.div.style.left = (mapPoint.x-this.icon.iconAnchor.x) + "px";
	this.div.style.top = (mapPoint.y-this.icon.iconAnchor.y) + "px";
	
	switch(this.state)
	{
		case 0:
			this.setInactive();
			break;
		case 1:
			this.setActive();
			break;
		case 2:
			this.setComp();
			break
	}
};
		
HomeMarker.prototype.onMouseDown=function(a)
{
		GEvent.trigger(this,"click",this);
		GEvent.trigger(this.map,"click",this)
};

HomeMarker.prototype.onMouseOver=function(a)
{
		GEvent.trigger(this,"mouseover",this);
		GEvent.trigger(this.map,"mouseover",this)
};

HomeMarker.prototype.onMouseOut=function(a)
{
		GEvent.trigger(this,"mouseout",this);
		GEvent.trigger(this.map,"mouseout",this)	
};

HomeMarker.prototype.setInactive=function()
{
	this.state = 0;
	if(_isIE == false)
	{
		this.div.src = this.icon.image;
		this.div.width = this.icon.iconSize.width;
		this.div.height = this.icon.iconSize.height;
	}
	else
	{
		this.div.style.width = this.icon.iconSize.width + "px";
		this.div.style.height = this.icon.iconSize.height + "px";
		this.div.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.icon.image + "',sizingMethod='scale')";
	}
        this.div.style.zIndex = this.zindex;
}

HomeMarker.prototype.setActive=function()
{
	this.state = 1;
	if(_isIE == false)
	{
		this.div.src = this.activeIcon.image;
		this.div.width = this.activeIcon.iconSize.width;
		this.div.height = this.activeIcon.iconSize.height;
	}
	else
	{
		this.div.style.width = this.activeIcon.iconSize.width + "px";
		this.div.style.height = this.activeIcon.iconSize.height + "px";
		this.div.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.activeIcon.image + "',sizingMethod='scale')";
	}
	this.div.style.zIndex = this.zindex+1000;
}

HomeMarker.prototype.setComp=function()
{
	this.state = 2;
	if(_isIE == false)
	{
		this.div.src = this.compIcon.image;
		this.div.width = this.compIcon.iconSize.width;
		this.div.height = this.compIcon.iconSize.height;
	}
	else
	{
		this.div.style.width = this.compIcon.iconSize.width + "px";
		this.div.style.height = this.compIcon.iconSize.height + "px";
		this.div.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.compIcon.image + "',sizingMethod='scale')";
	}
        this.div.style.zIndex = this.zindex+2000;
}

HomeMarker.prototype.copy=function()
{
	//return new BRMarker(this.imageUrl,this.point,this.scale,this.bounds)
	return new HomeMarker(this.image, this.activeImage,this.point,this.scale,this.bounds, this.zindex)
};

HomeMarker.prototype.getPoint=function(){ return this.point; }
HomeMarker.prototype.remove=function(){if(this.div&&this.div.parentNode){this.div.parentNode.removeChild(this.div)}};
HomeMarker.prototype.display=function(a){if(a)this.div.style.display="";else this.div.style.display="none";};
HomeMarker.prototype.setZIndex=function(a){this.div.style.zIndex=a;};
HomeMarker.prototype.getLatitude=window.GMarker.prototype.getLatitude;
HomeMarker.prototype.openInfoWindow=function(a,b){this.map.openInfoWindow(this.point,a,new GSize(0,0),GEvent.callback(this,this.onInfoWindowOpen),GEvent.callback(this,this.onInfoWindowClose),b)};
HomeMarker.prototype.openInfoWindowHtml=function(a,b){this.map.openInfoWindowHtml(this.point,a,new GSize(0,0),GEvent.callback(this,this.onInfoWindowOpen),GEvent.callback(this,this.onInfoWindowClose),b)};
HomeMarker.prototype.openInfoWindowXslt=function(a,b,c){this.map.openInfoWindowXslt(this.point,a,b,new GSize(0,0),GEvent.callback(this,this.onInfoWindowOpen),GEvent.callback(this,this.onInfoWindowClose),c)};
HomeMarker.prototype.showMapBlowup=function(a,b){this.map.showMapBlowup(this.point,a,b,new GSize(0,0),GEvent.callback(this,this.onInfoWindowOpen),GEvent.callback(this,this.onInfoWindowClose))};
HomeMarker.prototype.onInfoWindowOpen=window.GMarker.prototype.onInfoWindowOpen;
HomeMarker.prototype.onInfoWindowClose=window.GMarker.prototype.onInfoWindowClose; 


//initialize(map) 	none 	Called by the map after the overlay is added to the map using GMap2.addOverlay(). The overlay object can draw itself into the different panes of the map that can be obtained using GMap2.getPane().
//remove() 	none 	Called by the map after the overlay is removed from the map using GMap2.removeOverlay() or GMap2.clearOverlays(). The overlay must remove itself from the map panes here.
//copy() 	GOverlay 	Returns an uninitialized copy of itself that can be added to the map.
//redraw(force)
