	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_GSIcon(point, title, icon, width, height, zindex){
		this.point_=point;
		this.title_=title;
		this.icon_=icon;
		this.width_=width;
		this.height_=height;
		this.zIdx_ = zindex;
	}
	GX_GSIcon.prototype = new GOverlay();
	
	GX_GSIcon.prototype.initialize = function(m) {
		this.map_ = m;
		var img = document.createElement("img");  
		img.style.zIndex = this.zIdx_;
			//zIndex= GOverlay.getZIndex(this.point_.lat()));			
		img.style.position="absolute";
		img.style.width=this.width_+"px";
		img.style.height=this.height_+"px";		
		
		img.title = this.title_;
		img.alt = this.title_;
		img.style.cursor = "pointer";
		
		//hack to enable ie5.5+ png alpha. Fails on 5.0. Horribly.
		if(GX_pngSupport == true){
			img.src=this.icon_;		
			this.mainElem_=img; 	
		}else{
			var span = document.createElement("span");
			
			span.style.zIndex = this.zIdx_;
			span.style.position="absolute";
			span.style.width=this.width_+"px";
			span.style.height=this.height_+"px";
			span.style.display="inline-block";		
			span.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.icon_ + "')";
			
			img.src=this.icon_;
			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_GSIcon.prototype.setTooltip=function(tip) {
		//this.img_.title=tip;
		//this.img_.alt=tip;
		this.title_=tip;
	}
	
	GX_GSIcon.prototype.setIcon=function(icon) {
		this.icon_=icon;
	}
	
	GX_GSIcon.prototype.setZIndex=function(idx) {
		this.zIdx_=idx;
	}
	
	GX_GSIcon.prototype.remove=function() {
		this.mainElem_.parentNode.removeChild(this.mainElem_);
    }
	
	GX_GSIcon.prototype.copy=function() {
		return new GX_GSIcon(this.point_,this.title_,this.icon_,this.width_,this.height_);
	}
	
	GX_GSIcon.prototype.redraw=function(force) {
		if (!force) return;
		var p = this.map_.fromLatLngToDivPixel(this.point_);
		this.mainElem_.style.left = (p.x-parseInt(this.width_/2)) + "px";
		this.mainElem_.style.top = (p.y-parseInt(this.height_)) + "px";
	}
	
	GX_GSIcon.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.height_/2));
			
			var w = this.map_.fromDivPixelToLatLng(p);
			this.map_.openInfoWindowHtml(w,c);
		}
	}
	
	GX_GSIcon.prototype.openInfoWindowTabs = function(c){
		var q=this.point_;
		this.map_.openInfoWindowTabs(q,c);
	}
	
	GX_GSIcon.prototype.getPoint = function(){			
		return this.point_;
	}
	
	GX_GSIcon.prototype.getTitle = function(){			
		return this.title_;
	}
