function lowesmap(div,showSmallControl,showOverview,markerSize){
	
	this.mapDiv = div;
	this.markerPath = "/lfs/images/map/markers/";
	this.showSmallControl = true;
	this.showOverview = true;
	this.markers = [];
	this.googleAvail = true;
	this.markerSize = 'small';
	
	try{this.showSmallControl=showSmallControl}
	catch(e){}
	try{this.showOverview=showOverview}
	catch(e){}
	try{this.markerSize=markerSize}
	catch(e){}
	
	try{if(!GBrowserIsCompatible()){
		this.googleAvail = false;
	}}
	catch(e){this.googleAvail = false;}
	
	if (!this.googleAvail) $('#'+this.mapDiv).html('Maps are unavailable at this time.');
	else {
		if (!this.googleAvail){return false;}
		var theMap = $("#"+this.mapDiv).get();
		this.map = new GMap2(theMap[0],{mapTypes:[G_NORMAL_MAP]});
		if(this.showSmallControl){
			this.map.addControl(new GSmallMapControl());
		}
		if(this.showOverview){
			this.map.addControl(new GOverviewMapControl());
		}
		this.map.setCenter(new GLatLng(40.813560,-96.707730), 3);
		this.map.enableContinuousZoom();
	    this.mgr = new MarkerManager(this.map, {trackMarkers:true});
		this.bounds = new GLatLngBounds();
	}
	
	this.centerMap = function(lat,lon){
		if (!this.googleAvail){return false;}
		var pos = new GLatLng(lat,lon);
		this.map.setCenter(pos,9);
		return false;
	}
	
	this.clearMarkers = function() {
		if (!this.googleAvail){return false;}
		this.mgr.clearMarkers();
	}
	
	this.addMarker = function(lat,lon,image,id,addlistener){
		if (!this.googleAvail){return false;}
		var icon = this.getIcon(image);
		var type = type;
		var posn = new GLatLng(lat,lon);
		var marker = new GMarker(posn,{icon:icon,zIndexProcess:greebOnBottom});;
		marker.markerid = id; 
		if(addlistener){
			GEvent.addListener(marker, 'click',function(){
				$("#locatorResultsTable tbody tr[store_number='"+marker.markerid+"']").click();
			}); 
		}
		this.markers.push(marker);
		this.bounds.extend(posn);
	}
	function greebOnBottom(marker,b){
		var image = marker.getIcon().image.split("/").pop();
		if(image=='green.png')return 0;
		else return 1;
	}
	this.getIcon = function(image) {
		if (!this.googleAvail){return false;}
		var baseIcon = new GIcon();
		baseIcon.shadow = this.markerPath+'shadow.png';
		if(this.markerSize == 'small'){
			baseIcon.iconSize = new GSize(12, 20);
			baseIcon.shadowSize = new GSize(22, 20);	
		}
		if(this.markerSize == 'large'){
			baseIcon.iconSize = new GSize(20, 34);
			baseIcon.shadowSize = new GSize(34, 28);	
		}
		baseIcon.iconAnchor = new GPoint(5, 19);
		baseIcon.infoWindowAnchor = new GPoint(10, 1);
		baseIcon.infoShadowAnchor = new GPoint(18, 25);
		baseIcon.image = this.markerPath+image;
		return baseIcon;
	}
	
	this.refreshMarkers = function(){
		if (!this.googleAvail){return false;}
		this.mgr.clearMarkers();
		this.mgr.addMarkers(this.markers,1,17);
		this.mgr.refresh();
	}
	this.refreshZoom = function(zoomOut){
		if (!this.googleAvail){return false;}
		this.map.setZoom(this.map.getBoundsZoomLevel(this.bounds));
	   	this.map.setCenter(this.bounds.getCenter());
		try{if(zoomOut){this.map.zoomOut();}}
		catch(e){}
	}
	
	this.zoomOnMarker = function(lat,lon){
		if (!this.googleAvail){return false;}
		this.map.zoomIn(new GLatLng(lat,lon),true);
	}
	
}
