function WAMapRef(mapObj)  {

  this.obj = mapObj;

  this.directions = false;

  this.icons = [];

  this.markers = [];

  this.addresses = [];

  this.points = [];

  this.getPointByAddress = getPointByAddressFunc;

  return this;

}



function waitForGeo()  {

  var startDate = new Date();

  var endDate = new Date();

  while ((endDate-startDate) < 200)  {

    endDate = new Date();

  }

}



function WAMapPoint(theMarker, theAddress, theIcon)  {

  this.icon = theIcon;

  this.marker = theMarker;

  this.address = theAddress;

  return this;

}



function getPointByAddressFunc(value,attname)  {

  if (!attname) attname = "street";

  for (var x=0; x < this.addresses.length; x++) {

    if (eval("this.addresses[x]."+attname) == value)  {

      return WAMapPoint(this.markers[x],this.addresses[x],this.icons[x]);

    }

  }

  return false;

}




function wagmp_map_1() {

  if(GBrowserIsCompatible()) {

    if(!document.getElementById('wagmp_map_1')) return false;

    var map = new GMap2(document.getElementById('wagmp_map_1'));

    wagmp_map_1_obj = new WAMapRef(map);

    map.enableContinuousZoom();

    map.enableDoubleClickZoom();

    map.addControl(new GSmallMapControl());

    map.addControl(new GMapTypeControl());

    var geocoder = new GClientGeocoder();

    

    var fromAddress = {

      enabled: false,

      street: '',

      city: '',

      state: '',

      zip: '',

      country: '',

      full: ''

    };



    var icon_0 = new GIcon();

    icon_0.image = 'http://google.webassist.com/google/markers/pushpin/pacifica.png';

    icon_0.shadow = 'http://google.webassist.com/google/markers/pushpin/shadow.png';

    icon_0.iconSize = new GSize(40,41);

    icon_0.shadowSize = new GSize(40,41);

    icon_0.iconAnchor = new GPoint(7,38);

    icon_0.infoWindowAnchor = new GPoint(26,4);

    icon_0.printImage = 'http://google.webassist.com/google/markers/pushpin/pacifica.gif';

    icon_0.mozPrintImage = 'http://google.webassist.com/google/markers/pushpin/pacifica_mozprint.png';

    icon_0.printShadow = 'http://google.webassist.com/google/markers/pushpin/shadow.gif';

    icon_0.transparent = 'http://google.webassist.com/google/markers/pushpin/pacifica_transparent.png';

    

    var address_0 = {

      street: '',

      city: '',

      state: '',

      zip: '',

      country: '',

      infowindow: 'custom',

      infowindowtext: '<span style="font: 14px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Andersons Athy</strong><br /></span>',

      full: '52.992148,-6.983614',

      isdefault: true,

      addressType: 'coordinates',

      loop: '',

      latitude: '52.992148',

      longitude: '-6.983614',

      markerStyle: 'Push-Pin',

      markerColor: 'Pacifica'      

    };

    

    geocoder.getLatLng (

      address_0.full,

      function(point) {

        if(point) {

          var marker = new GMarker(point, icon_0);

          GEvent.addListener(marker, 'click', function() {

            marker.openInfoWindowHtml(address_0.infowindowtext);

          });

          if(!fromAddress.enabled || 'address_0' != 'address_0') {

            map.setCenter(point, 13);

            map.addOverlay(marker);

            marker.openInfoWindowHtml(address_0.infowindowtext);

          }

          wagmp_map_1_obj.markers.push(marker);

          wagmp_map_1_obj.addresses.push(address_0);

          wagmp_map_1_obj.icons.push(icon_0);

          wagmp_map_1_obj.points.push(point);

        }

        else {

          map.setCenter(new GLatLng(37.4419, -122.1419), 13);

        }

      }

    );

     waitForGeo();





  }

}