hiliteNum=0;

function FFHilite(point) 
{ 
  this._map = null; 
  this._zIndex = null;
  this._point=point;
} 

FFHilite.prototype = new GOverlay(); 
FFHilite.prototype.getPoint = function() { return this._point; } 
FFHilite.prototype.getIcon = function() { return this._icon; } 
FFHilite.prototype.getImage = function() { return this._img; } 
FFHilite.prototype.getText = function() { return this._text; } 


FFHilite.prototype.initialize = function(map) 
{ 

		this._map = map; 
		this.id="hilite";

		this._img=document.createElement("img");
		imagesrc="target.png";
		this._img.width = 20; 
		this._img.height = 12; 
 		this._img.parent=this;
 		this._img.style.position="absolute";
 		this._img.style.border="none";
		
		if (IE)
    	{
      	 	this._img.src = blankImg;
       	 	this._img.style.filter ="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +imagesrc + "')";
    	}
    	else
   		{
      	  	this._img.src = imagesrc;
   		}
    				
		var imgmapname = 'targetMap_' + this._idnum++;
	
		this._imgMap = document.createElement("map");
		this._imgMap.id = imgmapname;
		this._imgMap.name = imgmapname;
		this._imgMap.parent=this;
	
		
		 var imgMapArea = document.createElement("area");
		imgMapArea.alt = '';
		imgMapArea.shape = 'rect';
		imgMapArea.coords = "0,0,20,12";
		imgMapArea.href = 'javascript:void(0);';
		imgMapArea.parent = this;
		
		
		var triggerFn = GEvent.callbackArgs(GEvent, GEvent.trigger, this._map, 'click', this, this._point);
		imgMapArea.onclick = function(e) {
		if (e) { 
			e.cancelBubble = true; 
		} else if (event) { 
			event.cancelBubble = true; 
		} 
			centerMarker();			
			//triggerFn(); 
		}
		
		this._imgMap.appendChild(imgMapArea);
		map.getContainer().appendChild(this._imgMap);
		this._imgMap.style.zIndex = 0;
		this._img.useMap = '#' + imgmapname;
	
		this.redraw(1);
		map.getPane(G_MAP_MARKER_SHADOW_PANE).appendChild(this._img); 
 }
 


FFHilite.prototype.redraw = function(force) 
{ 
  if (!force) return; 

  var pixelPoint = this._map.fromLatLngToDivPixel(this._point); 
  pixelPoint.x -= 10; 
  pixelPoint.y -= 5; 
  var cssLeft = pixelPoint.x + 'px'; 
  var cssTop = pixelPoint.y + 'px'; 
  this._zIndex = GOverlay.getZIndex(this._point.lat()); 
  this._img.style.left = cssLeft; 
  this._img.style.top = cssTop;   
  this._img.style.zIndex = this._zIndex; 
} 

FFHilite.prototype.remove = function() 
{ 
  this._img.parentNode.removeChild(this._img); 
  this._imgMap.parentNode.removeChild(this._imgMap);
} 

FFHilite.prototype.copy = function() 
{ 
  return new FFHilite(this._point, this._icon); 

} 

FFHilite.prototype.getZIndex = function() { return this._zIndex; } 
FFHilite.prototype.setZIndex = function(zIndex) 
{ 
  this._zIndex = zIndex; 
  this._img.style.zIndex = this._zIndex; 
} 

FFHilite.prototype.resetZIndex = function() 
{ 

	this._zIndex = GOverlay.getZIndex(this._point.lat()); 
  	this._img.style.zIndex = this._zIndex; 
} 
