	//ngIcon v0.2. Bta. 16/07/08.
	//Changes from v0.1: getPoint(), getLatLng() functions added for interoperability reasons.
	//Public domain! Free! Etc! It's hardly complicated anyway ;)
	//Known issues: PNG transparency in old browsers. Infowindow is locked to the point (this is, actually, by design, but can be easily modified).
	
	// These really need to be set. You have been warned. NgIcon is designed to be used with 24-bit PNGs for transparency effects.
	var ngIcon_iconWidth;var ngIcon_iconHeight;var ngIcon_blankImage;var ngIcon_isExplorer;
	
	//Usage: setupNgIcon(int ImageWidth, int ImageHeight, str BlankGifUrl, bool isInternetExplorer)
	//Example: setupNgIcon(28,36,"images/googlemap_icons/blank.gif",document.all);
	function setupNgIcon(w,h,b,i){
		ngIcon_iconWidth=w;ngIcon_iconHeight=h;ngIcon_blankImage=b;ngIcon_isExplorer=i;
	}
	
	//Usage: var marker = new ngIcon(GLatLng Point, str Title, str IconUrl,(int width?,int height?,int offsetx?,int offsety?))
	//Example: var marker=new ngIcon(pt,label,"images/googlemap_icons/mIcon.png",10,10,5,5);
	//Example: var marker=new ngIcon(pt,label,"images/googlemap_icons/lm-p.png"); //defaults to ngIcon_iconWidth, iconHeight, iconWidth/2, iconHeight - sort of like a pin...
	function ngIcon(point,title,icon,width,height,offsetx,offsety){
		this.point_=point;
		this.title_=title;
		this.icon_=icon;
		this.width_=width||ngIcon_iconWidth;
		this.height_=height||ngIcon_iconHeight;
		this.offsetx_=offsetx||this.width_/2;
		this.offsety_=offsety||this.height_;//pass the null on...
	}
	
	//internal functions - probably don't need editing for general usage.
	ngIcon.prototype=new GOverlay();
	
	ngIcon.prototype.initialize=function(m) {
		var img=document.createElement("img");  
		with(img.style){zIndex=GOverlay.getZIndex(this.point_.lat());position="absolute";width=this.width_+"px";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. Please to fix.
		if(!ngIcon_isExplorer||self.opera!=null){
			img.src=this.icon_;
		}else{
			img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.icon_ +"')";img.src=ngIcon_blankImage;
		}
		this.map_=m;this.map_.getPane(G_MAP_MARKER_PANE).appendChild(img);this.img_=img;var me=this;
		GEvent.addDomListener(this.img_, 'click', function(){
			GEvent.trigger(me,"click");
		});
	}
	
	ngIcon.prototype.remove=function() {
		this.img_.parentNode.removeChild(this.img_);
    }
	
	ngIcon.prototype.copy=function() {
		return new ngIcon(this.point_,this.title_,this.icon_,this.width_,this.height_);
	}
	
	ngIcon.prototype.redraw=function(force) {
		if (!force) return;
		var p=this.map_.fromLatLngToDivPixel(this.point_);
		this.img_.style.left=(p.x-parseInt(this.offsetx_) + "px");
		this.img_.style.top=(p.y-parseInt(this.offsety_) + "px");
	}
	
	ngIcon.prototype.openInfoWindowHtml=function(c){
		var q=this.point_;
		this.map_.openInfoWindowHtml(q,c);
	}
	
	ngIcon.prototype.openInfoWindowTabs=function(c){
		var q=this.point_;
		this.map_.openInfoWindowTabs(q,c);
	}
	
	ngIcon.prototype.getPoint=function(){
		return this.point_;
	}
	
	ngIcon.prototype.getLatLng=function(){
		return this.point_;
	}