
(function () 
{
    google.maps.Marker.prototype.con = null;
    google.maps.Marker.prototype.activeIcon = null;
    google.maps.Marker.prototype.compIcon = null;
    google.maps.Marker.prototype.state = null;

    google.maps.Marker.prototype.setDefaults= function(inactiveIcon, activeIcon, compIcon, state)
    {
        this.inactiveIcon = inactiveIcon;
        this.activeIcon = activeIcon;
        this.compIcon = compIcon;
        this.state = state;
    };
     
    google.maps.Marker.prototype.setInactive=function()
    {
	    this.state = 0;
        this.setIcon(this.inactiveIcon);
    };
    google.maps.Marker.prototype.setActive=function()
    {
	    this.state = 1;
        this.setIcon(this.activeIcon);
    };
    google.maps.Marker.prototype.setComp=function()
    {
	    this.state = 2;
        this.setIcon(this.compIcon);
    };

    google.maps.Marker.prototype.copy=function()
    {
	    marker = new google.maps.Marker({position:this.getPosition(), map:this.getMap(), icon:this.getIcon(), zIndex:this.getZIndex()});
        marker.setDefaults(this.inactiveIcon, this.activeIcon, this.compIcon, this.state);
        return(marker);
    }
})();
/*

var HomeMarker = Class.create(
{ 
    initialize: function(map, 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;
        this.marker = new google.maps.Marker({ map:map, position:point, icon:image, zIndex: zindex});
    }
});

HomeMarker.prototype.obtain = function(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.OverlayImage.ownerDocument.createElement("img");
			this.div.src = this.icon.image;
			this.div.setAttribute("border", "0");
			
		}
		else
		{
			this.div=this.map.OverlayImage.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.OverlayImage.appendChild(this.div);
		this.bounds = this.map.get_bounds();
		
		this.div.oncontextmenu=function(){return false};

};
*/

/*		
HomeMarker.prototype.redraw=function(force)
{
	//debugger;
	if(!force)return;
	var mapPoint = this.map.fromLatLngToDivPixel(this.point)
	
	this.div.style.left = (mapPoint.x-this.icon.anchor.x) + "px";
	this.div.style.top = (mapPoint.y-this.icon.anchor.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')";
	}
}

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')";
	}
}

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')";
	}
}

HomeMarker.prototype.copy=function()
{
	//return new BRMarker(this.imageUrl,this.point,this.scale,this.bounds)
	marker = new HomeMarker();
    marker.obtain(this.image, this.activeImage,this.point,this.scale,this.bounds, this.zindex);
    return(marker);
};

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)
*/

