function gMap(mapObj) 
{
	this.mapObj     = mapObj;	
	this.bounds     = new GLatLngBounds;
	this.points     = new Array();
	this.categories = new Array();
	
	this.addCategory   = function(category){
		this.categories[category.name] = {icon:this._createMarkerIcon(category.icon)}
	}
	
	this.addPoint = function(point){
		var location    = new GLatLng(point.lat,point.long);
		var icon        = this.categories[point.category].icon;
		var show 		= point.always_show || 'false';
		var marker      = new GMarker(location,icon);
		var info		= this._createInfoWindow(point.name,point.address,point.website);
		
		this.points.push({category:point.category,marker:marker,info:info,show:show});
	}
	
	this.showPoints = function(category) 
	{
		category = category||"All";		
				
		this.mapObj.clearOverlays();
		this.bounds = new GLatLngBounds
		
		for(var i = 0; i < this.points.length; i++){			
			if(category == "All" || category == this.points[i].category || category.toString().indexOf(this.points[i].category)!=-1 || this.points[i].show == 'true'){
				this.mapObj.addOverlay(this.points[i].marker);				
				this.bounds.extend(this.points[i].marker.getPoint());
				this.points[i].marker.bindInfoWindowHtml(this.points[i].info);
			}
		}
		
		this.mapObj.setZoom(this.mapObj.getBoundsZoomLevel(this.bounds));
		this.mapObj.setCenter(this.bounds.getCenter());
	}			
	
	this.bindTo = function(element)
	{	
		var gmapObj = this;
		$(element).children().each(function(){
			$(this).children("a").click(function(){
				$("#map-markers li.active").removeClass("active");
				$(this).parent().addClass("active");
				gmapObj.showPoints($(this).attr("rel"))
			});
		});
		
		return false;
	}
	
	this._createInfoWindow = function(name,address,website)
	{	
		var string = "<div><b>"+name+"</b></div>";
		if(address) string = string+"<div>"+address+"</div>";
		
		return string;
	}	
		
	this._createMarkerIcon = function(opts) 
	{	
		/*var iconOptions 		 = {};
		iconOptions.width 		 = opts.width;
		iconOptions.height 		 = opts.height;
		iconOptions.primaryColor = opts.primaryColor;
		iconOptions.cornerColor  = opts.cornerColor;
		iconOptions.strokeColor  = opts.strokeColor;
		var marker 				 = MapIconMaker.createMarkerIcon(iconOptions);*/
		
		var marker = new GIcon(G_DEFAULT_ICON);
		/*if(opts.image){
			marker.image = opts.image;
			marker.iconSize = new GSize(opts.width,opts.height);
		}*/
		
		return marker;
	}
}
