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_8() {
  if(GBrowserIsCompatible()) {
    if(!document.getElementById('wagmp_map_8')) return false;
    var map = new GMap2(document.getElementById('wagmp_map_8'));
    wagmp_map_8_obj = new WAMapRef(map);
    map.enableContinuousZoom();
    map.enableDoubleClickZoom();
    map.addControl(new GLargeMapControl());
    map.addControl(new GScaleControl());
    map.addControl(new GMapTypeControl());
    map.addControl(new GOverviewMapControl());
    var geocoder = new GClientGeocoder();
    
    var fromAddress = {
      enabled: false,
      street: '',
      city: '',
      state: '',
      zip: '',
      country: '',
      full: ''
    };

    
    var icon_3 = new GIcon();
    icon_3.image = 'http://google.webassist.com/google/markers/star/poppy.png';
    icon_3.shadow = 'http://google.webassist.com/google/markers/star/shadow.png';
    icon_3.iconSize = new GSize(29,39);
    icon_3.shadowSize = new GSize(29,39);
    icon_3.iconAnchor = new GPoint(15,15);
    icon_3.infoWindowAnchor = new GPoint(19,7);
    icon_3.printImage = 'http://google.webassist.com/google/markers/star/poppy.gif';
    icon_3.mozPrintImage = 'http://google.webassist.com/google/markers/star/poppy_mozprint.png';
    icon_3.printShadow = 'http://google.webassist.com/google/markers/star/shadow.gif';
    icon_3.transparent = 'http://google.webassist.com/google/markers/star/poppy_transparent.png';
    
    var address_3 = {
      street: '',
      city: '',
      state: '',
      zip: '',
      country: '',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Pleasant Island</strong><br />Along the southern shore of Pleasant Island is a string<br /> of lovely sandy beaches. On our Wilderness Isles day trips,<br /> we land our kayaks here to enjoy a lunch of locally smoked<br /> salmon, fresh veggies and fruit. While ashore, we\'ll<br /> explore the moist interior of the forest, home to a<br /> variety of ferns, mushrooms and wildflowers. Moss<br /> carpets the forest floor, and drapes off the<br /> branches. This is truly old growth forest, and was<br /> not covered by recent glacial advances. We\'ll hike<br /> into open areas of bog muskeg, and soak up the<br /> ambience of this beautifully unique place.</span>',
      full: '58.346083,-135.617903',
      isdefault: false,
      addressType: 'coordinates',
      loop: '',
      latitude: '58.346083',
      longitude: '-135.617903',
      markerStyle: 'Star',
      markerColor: 'Poppy'      
    };
    
    var point_3 = new GLatLng(address_3.latitude, address_3.longitude);
      var marker_3 = new GMarker(point_3, icon_3);
      GEvent.addListener(marker_3, 'click', function() {
        marker_3.openInfoWindowHtml(address_3.infowindowtext);
      });
      if(!fromAddress.enabled || 'address_3' != 'address_8') {
            map.setCenter(point_3, 13);
            map.addOverlay(marker_3);
            marker_3.openInfoWindowHtml(address_3.infowindowtext);
      }
      wagmp_map_8_obj.markers.push(marker_3);
      wagmp_map_8_obj.addresses.push(address_3);
      wagmp_map_8_obj.icons.push(icon_3);
      wagmp_map_8_obj.points.push(point_3);

    var icon_5 = new GIcon();
    icon_5.image = 'http://google.webassist.com/google/markers/star/desertspice.png';
    icon_5.shadow = 'http://google.webassist.com/google/markers/star/shadow.png';
    icon_5.iconSize = new GSize(29,39);
    icon_5.shadowSize = new GSize(29,39);
    icon_5.iconAnchor = new GPoint(15,15);
    icon_5.infoWindowAnchor = new GPoint(19,7);
    icon_5.printImage = 'http://google.webassist.com/google/markers/star/desertspice.gif';
    icon_5.mozPrintImage = 'http://google.webassist.com/google/markers/star/desertspice_mozprint.png';
    icon_5.printShadow = 'http://google.webassist.com/google/markers/star/shadow.gif';
    icon_5.transparent = 'http://google.webassist.com/google/markers/star/desertspice_transparent.png';
    
    var address_5 = {
      street: '',
      city: '',
      state: '',
      zip: '',
      country: '',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Pt. Adolphus</strong><br />At Pt. Adolphus, we\'ll observe the movement of<br /> humpback whales, as we paddle our sea kayaks near the<br /> shore of Chichagof Island. From the 1,000 foot<br /> depths of Icy Strait to the rocky shorelines, this is a<br /> sea kayaking paradise of immense scale and<br /> beauty, and offers us the opportunity to view and<br /> photograph the amazing humpback whales, stellar<br /> sea lions, and harbor seals that congregate here to<br /> feed each summer.</span>',
      full: '58.284411,-135.799769',
      isdefault: false,
      addressType: 'coordinates',
      loop: '',
      latitude: '58.284411',
      longitude: '-135.799769',
      markerStyle: 'Star',
      markerColor: 'Desert Spice'      
    };
    
    var point_5 = new GLatLng(address_5.latitude, address_5.longitude);
      var marker_5 = new GMarker(point_5, icon_5);
      GEvent.addListener(marker_5, 'click', function() {
        marker_5.openInfoWindowHtml(address_5.infowindowtext);
      });
      if(!fromAddress.enabled || 'address_5' != 'address_8') {
            map.setCenter(point_5, 13);
            map.addOverlay(marker_5);
            marker_5.openInfoWindowHtml(address_5.infowindowtext);
      }
      wagmp_map_8_obj.markers.push(marker_5);
      wagmp_map_8_obj.addresses.push(address_5);
      wagmp_map_8_obj.icons.push(icon_5);
      wagmp_map_8_obj.points.push(point_5);

    var icon_6 = new GIcon();
    icon_6.image = 'http://google.webassist.com/google/markers/star/moab.png';
    icon_6.shadow = 'http://google.webassist.com/google/markers/star/shadow.png';
    icon_6.iconSize = new GSize(29,39);
    icon_6.shadowSize = new GSize(29,39);
    icon_6.iconAnchor = new GPoint(15,15);
    icon_6.infoWindowAnchor = new GPoint(19,7);
    icon_6.printImage = 'http://google.webassist.com/google/markers/star/moab.gif';
    icon_6.mozPrintImage = 'http://google.webassist.com/google/markers/star/moab_mozprint.png';
    icon_6.printShadow = 'http://google.webassist.com/google/markers/star/shadow.gif';
    icon_6.transparent = 'http://google.webassist.com/google/markers/star/moab_transparent.png';
    
    var address_6 = {
      street: '',
      city: '',
      state: '',
      zip: '',
      country: '',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Mud Bay</strong><br />We paddle our kayaks up Mud River to explore for brown<br /> bears, examine the forest wilderness, view flocks of<br /> ducks and geese in the open meadows, and<br /> photograph the vivid displays of lupine, irises, river<br /> beauties, chocolate lilies, bog orchids and Indian<br /> paintbrush. Bears in this area forage on the<br /> abundance of berries, and pink salmon make a<br /> mid-season run up the river. For those who are<br /> interested, stream fishing for Dolly Varden in the<br /> Mud River is world-class.</span>',
      full: '58.176044,-135.971775',
      isdefault: false,
      addressType: 'coordinates',
      loop: '',
      latitude: '58.176044',
      longitude: '-135.971775',
      markerStyle: 'Star',
      markerColor: 'Moab'      
    };
    
    var point_6 = new GLatLng(address_6.latitude, address_6.longitude);
      var marker_6 = new GMarker(point_6, icon_6);
      GEvent.addListener(marker_6, 'click', function() {
        marker_6.openInfoWindowHtml(address_6.infowindowtext);
      });
      if(!fromAddress.enabled || 'address_6' != 'address_8') {
            map.setCenter(point_6, 13);
            map.addOverlay(marker_6);
            marker_6.openInfoWindowHtml(address_6.infowindowtext);
      }
      wagmp_map_8_obj.markers.push(marker_6);
      wagmp_map_8_obj.addresses.push(address_6);
      wagmp_map_8_obj.icons.push(icon_6);
      wagmp_map_8_obj.points.push(point_6);

    var icon_7 = new GIcon();
    icon_7.image = 'http://google.webassist.com/google/markers/star/deepjungle.png';
    icon_7.shadow = 'http://google.webassist.com/google/markers/star/shadow.png';
    icon_7.iconSize = new GSize(29,39);
    icon_7.shadowSize = new GSize(29,39);
    icon_7.iconAnchor = new GPoint(15,15);
    icon_7.infoWindowAnchor = new GPoint(19,7);
    icon_7.printImage = 'http://google.webassist.com/google/markers/star/deepjungle.gif';
    icon_7.mozPrintImage = 'http://google.webassist.com/google/markers/star/deepjungle_mozprint.png';
    icon_7.printShadow = 'http://google.webassist.com/google/markers/star/shadow.gif';
    icon_7.transparent = 'http://google.webassist.com/google/markers/star/deepjungle_transparent.png';
    
    var address_7 = {
      street: '',
      city: '',
      state: '',
      zip: '',
      country: '',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Idaho Inlet</strong><br />As we paddle past Idaho Inlet, we often see small groups<br /> of adorable sea otters, and we\'ll observe them<br /> silently from our kayaks. Otters keep their fur<br /> immaculately clean, and their constant grooming is<br /> highly entertaining.</span>',
      full: '58.159928,-136.218967',
      isdefault: false,
      addressType: 'coordinates',
      loop: '',
      latitude: '58.159928',
      longitude: '-136.218967',
      markerStyle: 'Star',
      markerColor: 'Deep Jungle'      
    };
    
    var point_7 = new GLatLng(address_7.latitude, address_7.longitude);
      var marker_7 = new GMarker(point_7, icon_7);
      GEvent.addListener(marker_7, 'click', function() {
        marker_7.openInfoWindowHtml(address_7.infowindowtext);
      });
      if(!fromAddress.enabled || 'address_7' != 'address_8') {
            map.setCenter(point_7, 13);
            map.addOverlay(marker_7);
            marker_7.openInfoWindowHtml(address_7.infowindowtext);
      }
      wagmp_map_8_obj.markers.push(marker_7);
      wagmp_map_8_obj.addresses.push(address_7);
      wagmp_map_8_obj.icons.push(icon_7);
      wagmp_map_8_obj.points.push(point_7);

    var icon_8 = new GIcon();
    icon_8.image = 'http://google.webassist.com/google/markers/star/pacifica.png';
    icon_8.shadow = 'http://google.webassist.com/google/markers/star/shadow.png';
    icon_8.iconSize = new GSize(29,39);
    icon_8.shadowSize = new GSize(29,39);
    icon_8.iconAnchor = new GPoint(15,15);
    icon_8.infoWindowAnchor = new GPoint(19,7);
    icon_8.printImage = 'http://google.webassist.com/google/markers/star/pacifica.gif';
    icon_8.mozPrintImage = 'http://google.webassist.com/google/markers/star/pacifica_mozprint.png';
    icon_8.printShadow = 'http://google.webassist.com/google/markers/star/shadow.gif';
    icon_8.transparent = 'http://google.webassist.com/google/markers/star/pacifica_transparent.png';
    
    var address_8 = {
      street: '',
      city: '',
      state: '',
      zip: '',
      country: '',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Whales!</strong><br />Our Whales! trips are 2-day to 7-day adventures,<br /> and focus on two great attractions of Southeast Alaska:<br /> whales and wildlife. We spend ample time watching both.<br />  The views we see during this expedition are<br /> unbelievable. Our itinerary is flexible, allowing us to observe<br /> fantastic whale behaviors, and a great variety of wildlife.</span>',
      full: '58.278815,-135.966547',
      isdefault: true,
      addressType: 'coordinates',
      loop: '',
      latitude: '58.278815',
      longitude: '-135.966547',
      markerStyle: 'Star',
      markerColor: 'Pacifica'      
    };
    
    var point_8 = new GLatLng(address_8.latitude, address_8.longitude);
      var marker_8 = new GMarker(point_8, icon_8);
      GEvent.addListener(marker_8, 'click', function() {
        marker_8.openInfoWindowHtml(address_8.infowindowtext);
      });
      if(!fromAddress.enabled || 'address_8' != 'address_8') {
            map.setCenter(point_8, 10);
            map.addOverlay(marker_8);
            marker_8.openInfoWindowHtml(address_8.infowindowtext);
      }
      wagmp_map_8_obj.markers.push(marker_8);
      wagmp_map_8_obj.addresses.push(address_8);
      wagmp_map_8_obj.icons.push(icon_8);
      wagmp_map_8_obj.points.push(point_8);


  }
}
