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_6() {
  if(GBrowserIsCompatible()) {
    if(!document.getElementById('wagmp_map_6')) return false;
    var map = new GMap2(document.getElementById('wagmp_map_6'));
    wagmp_map_6_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/traditionalflat/deepjungle.png';
    icon_0.shadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.png';
    icon_0.iconSize = new GSize(34,35);
    icon_0.shadowSize = new GSize(34,35);
    icon_0.iconAnchor = new GPoint(9,33);
    icon_0.infoWindowAnchor = new GPoint(19,0);
    icon_0.printImage = 'http://google.webassist.com/google/markers/traditionalflat/deepjungle.gif';
    icon_0.mozPrintImage = 'http://google.webassist.com/google/markers/traditionalflat/deepjungle_mozprint.png';
    icon_0.printShadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.gif';
    icon_0.transparent = 'http://google.webassist.com/google/markers/traditionalflat/deepjungle_transparent.png';
    
    var address_0 = {
      street: '1501 East 6th Street',
      city: 'Sterling',
      state: 'IL',
      zip: '61081',
      country: '',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Address:</strong><br />Lincoln Elementary School<br />1501 East 6th Street<br />Sterling, IL 61081</span>',
      full: '1501 East 6th Street, Sterling, IL, 61081',
      isdefault: false,
      addressType: 'address',
      loop: '',
      latitude: '',
      longitude: '',
      markerStyle: 'Google Traditional (flat)',
      markerColor: 'Deep Jungle'      
    };
    
    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_6') {
            map.setCenter(point, 13);
            map.addOverlay(marker);
          }
          wagmp_map_6_obj.markers.push(marker);
          wagmp_map_6_obj.addresses.push(address_0);
          wagmp_map_6_obj.icons.push(icon_0);
          wagmp_map_6_obj.points.push(point);
        }
        else {
          map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        }
      }
    );
     waitForGeo();

    var icon_1 = new GIcon();
    icon_1.image = 'http://google.webassist.com/google/markers/traditionalflat/deepjungle.png';
    icon_1.shadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.png';
    icon_1.iconSize = new GSize(34,35);
    icon_1.shadowSize = new GSize(34,35);
    icon_1.iconAnchor = new GPoint(9,33);
    icon_1.infoWindowAnchor = new GPoint(19,0);
    icon_1.printImage = 'http://google.webassist.com/google/markers/traditionalflat/deepjungle.gif';
    icon_1.mozPrintImage = 'http://google.webassist.com/google/markers/traditionalflat/deepjungle_mozprint.png';
    icon_1.printShadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.gif';
    icon_1.transparent = 'http://google.webassist.com/google/markers/traditionalflat/deepjungle_transparent.png';
    
    var address_1 = {
      street: '1700 6th Avenue',
      city: 'Sterling',
      state: 'IL',
      zip: '61081',
      country: '',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Address:</strong><br />Challand Middle School<br />1700 6th Avenue<br />Sterling, IL 61081</span>',
      full: '1700 6th Avenue, Sterling, IL, 61081',
      isdefault: false,
      addressType: 'address',
      loop: '',
      latitude: '',
      longitude: '',
      markerStyle: 'Google Traditional (flat)',
      markerColor: 'Deep Jungle'      
    };
    
    geocoder.getLatLng (
      address_1.full,
      function(point) {
        if(point) {
          var marker = new GMarker(point, icon_1);
          GEvent.addListener(marker, 'click', function() {
            marker.openInfoWindowHtml(address_1.infowindowtext);
          });
          if(!fromAddress.enabled || 'address_1' != 'address_6') {
            map.setCenter(point, 13);
            map.addOverlay(marker);
          }
          wagmp_map_6_obj.markers.push(marker);
          wagmp_map_6_obj.addresses.push(address_1);
          wagmp_map_6_obj.icons.push(icon_1);
          wagmp_map_6_obj.points.push(point);
        }
        else {
          map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        }
      }
    );
     waitForGeo();

    var icon_2 = new GIcon();
    icon_2.image = 'http://google.webassist.com/google/markers/traditionalflat/cabosunset.png';
    icon_2.shadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.png';
    icon_2.iconSize = new GSize(34,35);
    icon_2.shadowSize = new GSize(34,35);
    icon_2.iconAnchor = new GPoint(9,33);
    icon_2.infoWindowAnchor = new GPoint(19,0);
    icon_2.printImage = 'http://google.webassist.com/google/markers/traditionalflat/cabosunset.gif';
    icon_2.mozPrintImage = 'http://google.webassist.com/google/markers/traditionalflat/cabosunset_mozprint.png';
    icon_2.printShadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.gif';
    icon_2.transparent = 'http://google.webassist.com/google/markers/traditionalflat/cabosunset_transparent.png';
    
    var address_2 = {
      street: '1510 East 25th Street',
      city: 'Sterling',
      state: 'IL',
      zip: '61081',
      country: '',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Address:</strong><br />Franklin Elementary School<br />1510 East 25th Street<br />Sterling, IL 61081</span>',
      full: '1510 East 25th Street, Sterling, IL, 61081',
      isdefault: false,
      addressType: 'address',
      loop: '',
      latitude: '',
      longitude: '',
      markerStyle: 'Google Traditional (flat)',
      markerColor: 'Cabo Sunset'      
    };
    
    geocoder.getLatLng (
      address_2.full,
      function(point) {
        if(point) {
          var marker = new GMarker(point, icon_2);
          GEvent.addListener(marker, 'click', function() {
            marker.openInfoWindowHtml(address_2.infowindowtext);
          });
          if(!fromAddress.enabled || 'address_2' != 'address_6') {
            map.setCenter(point, 13);
            map.addOverlay(marker);
          }
          wagmp_map_6_obj.markers.push(marker);
          wagmp_map_6_obj.addresses.push(address_2);
          wagmp_map_6_obj.icons.push(icon_2);
          wagmp_map_6_obj.points.push(point);
        }
        else {
          map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        }
      }
    );
     waitForGeo();

    var icon_3 = new GIcon();
    icon_3.image = 'http://google.webassist.com/google/markers/traditionalflat/tahitisea.png';
    icon_3.shadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.png';
    icon_3.iconSize = new GSize(34,35);
    icon_3.shadowSize = new GSize(34,35);
    icon_3.iconAnchor = new GPoint(9,33);
    icon_3.infoWindowAnchor = new GPoint(19,0);
    icon_3.printImage = 'http://google.webassist.com/google/markers/traditionalflat/tahitisea.gif';
    icon_3.mozPrintImage = 'http://google.webassist.com/google/markers/traditionalflat/tahitisea_mozprint.png';
    icon_3.printShadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.gif';
    icon_3.transparent = 'http://google.webassist.com/google/markers/traditionalflat/tahitisea_transparent.png';
    
    var address_3 = {
      street: '815 West LeFevre Road',
      city: 'Sterling',
      state: 'IL',
      zip: '61081',
      country: '',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Address:</strong><br />Washington Elementary School<br />815 West LeFevre Road<br />Sterling, IL 61081</span>',
      full: '815 West LeFevre Road, Sterling, IL, 61081',
      isdefault: false,
      addressType: 'address',
      loop: '',
      latitude: '',
      longitude: '',
      markerStyle: 'Google Traditional (flat)',
      markerColor: 'Tahiti Sea'      
    };
    
    geocoder.getLatLng (
      address_3.full,
      function(point) {
        if(point) {
          var marker = new GMarker(point, icon_3);
          GEvent.addListener(marker, 'click', function() {
            marker.openInfoWindowHtml(address_3.infowindowtext);
          });
          if(!fromAddress.enabled || 'address_3' != 'address_6') {
            map.setCenter(point, 13);
            map.addOverlay(marker);
          }
          wagmp_map_6_obj.markers.push(marker);
          wagmp_map_6_obj.addresses.push(address_3);
          wagmp_map_6_obj.icons.push(icon_3);
          wagmp_map_6_obj.points.push(point);
        }
        else {
          map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        }
      }
    );
     waitForGeo();

    var icon_4 = new GIcon();
    icon_4.image = 'http://google.webassist.com/google/markers/traditionalflat/slate.png';
    icon_4.shadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.png';
    icon_4.iconSize = new GSize(34,35);
    icon_4.shadowSize = new GSize(34,35);
    icon_4.iconAnchor = new GPoint(9,33);
    icon_4.infoWindowAnchor = new GPoint(19,0);
    icon_4.printImage = 'http://google.webassist.com/google/markers/traditionalflat/slate.gif';
    icon_4.mozPrintImage = 'http://google.webassist.com/google/markers/traditionalflat/slate_mozprint.png';
    icon_4.printShadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.gif';
    icon_4.transparent = 'http://google.webassist.com/google/markers/traditionalflat/slate_transparent.png';
    
    var address_4 = {
      street: '506 West 4th Street',
      city: 'Sterling',
      state: 'IL',
      zip: '61081',
      country: '',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Address:</strong><br />Wallace Educational Center<br />506 West 4th Street<br />Sterling, IL 61081</span>',
      full: '506 West 4th Street, Sterling, IL, 61081',
      isdefault: false,
      addressType: 'address',
      loop: '',
      latitude: '',
      longitude: '',
      markerStyle: 'Google Traditional (flat)',
      markerColor: 'Slate'      
    };
    
    geocoder.getLatLng (
      address_4.full,
      function(point) {
        if(point) {
          var marker = new GMarker(point, icon_4);
          GEvent.addListener(marker, 'click', function() {
            marker.openInfoWindowHtml(address_4.infowindowtext);
          });
          if(!fromAddress.enabled || 'address_4' != 'address_6') {
            map.setCenter(point, 13);
            map.addOverlay(marker);
          }
          wagmp_map_6_obj.markers.push(marker);
          wagmp_map_6_obj.addresses.push(address_4);
          wagmp_map_6_obj.icons.push(icon_4);
          wagmp_map_6_obj.points.push(point);
        }
        else {
          map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        }
      }
    );
     waitForGeo();

    var icon_5 = new GIcon();
    icon_5.image = 'http://google.webassist.com/google/markers/traditionalflat/pacifica.png';
    icon_5.shadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.png';
    icon_5.iconSize = new GSize(34,35);
    icon_5.shadowSize = new GSize(34,35);
    icon_5.iconAnchor = new GPoint(9,33);
    icon_5.infoWindowAnchor = new GPoint(19,0);
    icon_5.printImage = 'http://google.webassist.com/google/markers/traditionalflat/pacifica.gif';
    icon_5.mozPrintImage = 'http://google.webassist.com/google/markers/traditionalflat/pacifica_mozprint.png';
    icon_5.printShadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.gif';
    icon_5.transparent = 'http://google.webassist.com/google/markers/traditionalflat/pacifica_transparent.png';
    
    var address_5 = {
      street: '806 East LeFevre Road',
      city: 'Sterling',
      state: 'IL',
      zip: '61081',
      country: '',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Address:</strong><br />Jefferson School<br />806 East LeFevre Road<br />Sterling, IL 61081</span>',
      full: '806 East LeFevre Road, Sterling, IL, 61081',
      isdefault: false,
      addressType: 'address',
      loop: '',
      latitude: '',
      longitude: '',
      markerStyle: 'Google Traditional (flat)',
      markerColor: 'Pacifica'      
    };
    
    geocoder.getLatLng (
      address_5.full,
      function(point) {
        if(point) {
          var marker = new GMarker(point, icon_5);
          GEvent.addListener(marker, 'click', function() {
            marker.openInfoWindowHtml(address_5.infowindowtext);
          });
          if(!fromAddress.enabled || 'address_5' != 'address_6') {
            map.setCenter(point, 13);
            map.addOverlay(marker);
          }
          wagmp_map_6_obj.markers.push(marker);
          wagmp_map_6_obj.addresses.push(address_5);
          wagmp_map_6_obj.icons.push(icon_5);
          wagmp_map_6_obj.points.push(point);
        }
        else {
          map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        }
      }
    );
     waitForGeo();

    var icon_6 = new GIcon();
    icon_6.image = 'http://google.webassist.com/google/markers/traditionalflat/nautica.png';
    icon_6.shadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.png';
    icon_6.iconSize = new GSize(34,35);
    icon_6.shadowSize = new GSize(34,35);
    icon_6.iconAnchor = new GPoint(9,33);
    icon_6.infoWindowAnchor = new GPoint(19,0);
    icon_6.printImage = 'http://google.webassist.com/google/markers/traditionalflat/nautica.gif';
    icon_6.mozPrintImage = 'http://google.webassist.com/google/markers/traditionalflat/nautica_mozprint.png';
    icon_6.printShadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.gif';
    icon_6.transparent = 'http://google.webassist.com/google/markers/traditionalflat/nautica_transparent.png';
    
    var address_6 = {
      street: '1608 4th Avenue',
      city: 'Sterling',
      state: 'IL',
      zip: '61081',
      country: '',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Address:</strong><br />Sterling High School/District Office<br />1608 4th Avenue<br />Sterling, IL 61081 United States</span>',
      full: '1608 4th Avenue, Sterling, IL, 61081',
      isdefault: true,
      addressType: 'address',
      loop: '',
      latitude: '',
      longitude: '',
      markerStyle: 'Google Traditional (flat)',
      markerColor: 'Nautica'      
    };
    
    geocoder.getLatLng (
      address_6.full,
      function(point) {
        if(point) {
          var marker = new GMarker(point, icon_6);
          GEvent.addListener(marker, 'click', function() {
            marker.openInfoWindowHtml(address_6.infowindowtext);
          });
          if(!fromAddress.enabled || 'address_6' != 'address_6') {
            map.setCenter(point, 13);
            map.addOverlay(marker);
            marker.openInfoWindowHtml(address_6.infowindowtext);
          }
          wagmp_map_6_obj.markers.push(marker);
          wagmp_map_6_obj.addresses.push(address_6);
          wagmp_map_6_obj.icons.push(icon_6);
          wagmp_map_6_obj.points.push(point);
        }
        else {
          map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        }
      }
    );
     waitForGeo();


  }
}
