function LocalSearchLocations(map_ref, loading_ref) {

  //member variables
  this.map_ref = map_ref;
  this.loading_ref = loading_ref;

  //Set functions declaration
  this.plot_locations = plot_locations;
} 

//Set function implimentation
function plot_locations(loc_type, center_lat, center_lng) {

  //BUILD THE GICON
  var location_icon = new GIcon();

  location_icon.image = state_machine.get_static_url() + "images/" + loc_type + ".png";
  location_icon.shadow = state_machine.get_static_url() + "images/" + loc_type + ".shadow.png";
  location_icon.iconSize = new GSize(32, 32);
  location_icon.shadowSize = new GSize(59, 32);
  location_icon.iconAnchor = new GPoint(9, 34);
  location_icon.infoWindowAnchor = new GPoint(9, 20);

  markerOptions = { icon:location_icon };

  var url = '/local_search.xml?type=' + loc_type + '&lat=' + center_lat + '&lng=' + center_lng;


  //This is a hack to give the class globals local scope
  var map_ref = this.map_ref;
  var loading_ref = this.loading_ref;

  $.ajax({
    method: "GET",
    url: url,
    //dataType: ($.browser.msie) ? "xml" : "text/xml",
    dataType: "xml",
    cache: false,
    beforeSend: function(){
      loading_ref.show();
    },
    complete: function(){ loading_ref.hide();}, //stop showing loading when the process is complete
    success: function(html){
      loading_ref.hide();
      $(html).find('location').each(function() {
        var point = new GLatLng($(this).attr("lat"), $(this).attr("lng"));
        var mHtml = "<div style='padding: 5px 10px 10px 10px;'>";
        mHtml += "<div style='text-align:left;margin-bottom:5px;'><b>" + $(this).attr("title") + "</b></div>";
        mHtml += "<div style='text-align:left;line-height:1.1em;'>" + $(this).attr("address") + "<br>" + $(this).attr("city") + ", " + $(this).attr("state") + "</div>";
        if ($(this).attr("url") != "None") { 
          mHtml += "<div style='text-align:left;margin-top:5px;'><a rel='nofollow' href='" + $(this).attr("url") + "'>" + $(this).attr("url") + "</a></div>";
        }
        mHtml += "</div>";

        var marker = new GMarker(point,markerOptions);

        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(mHtml);
        });

        map_ref.addOverlay(marker);
      });
    }
  });
}
