	var GX_pngSupport = (msieversion() > 6)? true: false;
	//alert(GX_pngSupport);

	function msieversion() {
      var ua = window.navigator.userAgent;
      var msie = ua.indexOf("MSIE ");
      if(msie > 0) // If Internet Explorer, return version number
         return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )));
      else                 // If another browser, return 10
         return 10;
   }
	

	//Usage: var marker = new GX_GSIcon(GLatLng Point, str Title, str IconUrl,int width,int height)	
	function GX_GazetteerMarker(gazetteer){
		this.gp_ = gazetteer;
		this.point_ = new GLatLng(this.gp_.centerPoint.GX_lat, this.gp_.centerPoint.GX_lon);
	}
	GX_GazetteerMarker.prototype = new GOverlay();
	
	GX_GazetteerMarker.prototype.initialize = function(m) {
		this.map_ = m;
				
		var img = document.createElement("img");  
		img.style.zIndex = this.gp_.getZIndex();
		img.style.position="absolute";
		img.style.width=this.gp_.getMarkerWidth()+"px";
		img.style.height=this.gp_.getMarkerHeight()+"px";		
		
		var tooltip = this.gp_.getTooltipText();
		img.title = tooltip;
		img.alt = tooltip;
		img.style.cursor = "pointer";
		
		//hack to enable ie5.5+ png alpha. Fails on 5.0. Horribly.
		if(GX_pngSupport == true){
			img.src=this.gp_.getMarkerIconImage();		
			this.mainElem_=img; 	
		}else{
			var span = document.createElement("span");
			
			span.style.zIndex = this.gp_.getZIndex();
			span.style.position="absolute";
			span.style.width=this.gp_.getMarkerWidth()+"px";
			span.style.height=this.gp_.getMarkerHeight()+"px";
			span.style.display="inline-block";		
			span.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.gp_.getMarkerIconImage() + "')";
			
			img.src=this.gp_.getMarkerIconImage();
			img.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)";			
			span.appendChild(img);
			this.mainElem_=span;			
		}
		
		this.map_.getPane(G_MAP_MARKER_PANE).appendChild(this.mainElem_);
		this.img_ = img;
		var me = this;
		GEvent.addDomListener(this.mainElem_, 'click', function(){
			GEvent.trigger(me, "click");
		});
	}
	
	
	GX_GazetteerMarker.prototype.remove=function() {
		this.mainElem_.parentNode.removeChild(this.mainElem_);
    }
	
	GX_GazetteerMarker.prototype.copy=function() {
		return new GX_GSIcon(this.point_,this.title_,this.icon_,this.width_,this.height_);
	}
	
	GX_GazetteerMarker.prototype.redraw=function(force) {
		if (!force) return;
		var p = this.map_.fromLatLngToDivPixel(this.point_);
		this.mainElem_.style.left = (p.x-parseInt(this.gp_.getMarkerWidth()/2)) + "px";
		this.mainElem_.style.top = (p.y-parseInt(this.gp_.getMarkerHeight())) + "px";
	}
	
	GX_GazetteerMarker.prototype.openInfoWindowHtml = function(c){
		if(this.map_) {
			var p = this.map_.fromLatLngToDivPixel(this.point_);
			//p.x = (p.x+parseInt(this.width_/2));
			p.y = (p.y-parseInt(this.gp_.getMarkerHeight()/2));
			
			var w = this.map_.fromDivPixelToLatLng(p);
			this.map_.openInfoWindowHtml(w,c);
		}
	}
	
	GX_GazetteerMarker.prototype.openInfoWindowTabs = function(c){
		var q=this.point_;
		this.map_.openInfoWindowTabs(q,c);
	}
	
	GX_GazetteerMarker.prototype.getPoint = function(){			
		return this.point_;
	}
	
	GX_GazetteerMarker.prototype.getGazetteer = function(){			
		return this.gp_;
	}
