var mapPoly;
var _mSvgForced = true; 
var _mSvgEnabled = true;
var isIE = navigator.userAgent.indexOf("MSIE") != -1


// define custom house icon
var baseIcon = new GIcon(G_DEFAULT_ICON);
baseIcon.shadow = "icon_house_shadow.png";
baseIcon.iconSize = new GSize(36, 47);
baseIcon.shadowSize = new GSize(41, 35);
baseIcon.iconAnchor = new GPoint(18, 47 );
baseIcon.infoWindowAnchor = new GPoint(30, 0);

// set ward styles
var bColorStart = "#003D90";
var bWeightStart = 2;
var bOpacityStart = 1.0;
var fColorStart = "#003D90";
var fOpacityStart = 0.2;
var bColorOver = "#003D90";
var bWeightOver = 2;
var bOpacityOver = 1.0;
var fColorOver = "#00C6FF";
var fOpacityOver = 0.6;
var bColorFocus = "#003D90";
var bWeightFocus = 2;
var bOpacityFocus = .6;
var fColorFocus = "#00C6FF";
var fOpacityFocus = 0;

// set ward centers
var w1lat = 38.924864;
var w1lng = -77.031043;
var w1zm = 14;
var w2lat = 38.888002;
var w2lng = -77.044544;
var w2zm = 13;
var w3lat = 38.93729;
var w3lng = -77.082653;
var w3zm = 13;
var w4lat = 38.967193;
var w4lng = -77.036476;
var w4zm = 13;
var w5lat = 38.925338;
var w5lng = -76.984549;
var w5zm = 13;
var w6lat = 38.883014;
var w6lng = -76.997587;
var w6zm = 13;
var w7lat = 38.888449;
var w7lng = -76.944079;
var w7zm = 13;
var w8lat = 38.839161;
var w8lng = -77.004465;
var w8zm = 13;

function newMap(div) {		
  if (GBrowserIsCompatible()){
    var map = new GMap2(document.getElementById(div));
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.addControl(new GScaleControl());
    map.setCenter(new GLatLng(38.895,-77.016), 11);				
    map.enableContinuousZoom();
    map.enableDoubleClickZoom();
    map.enableScrollWheelZoom();
    geocoder = new GClientGeocoder();
    // map.enableGoogleBar(); 
    return map;
  }
}

function createMarker(point,id) {
  var houseIcon = new GIcon(baseIcon);
  houseIcon.image = "icon_house.png";
  markerOptions = { icon:houseIcon };
  var marker = new GMarker(point, markerOptions);
  GEvent.addListener(marker, "click", function() {
    mapPoly.setCenter(point);
    mapInfo(id);
  });
  return marker;
}

function addMarkers(wnum,start,end){
  for (var i=start; i<end; i++) {
    mapPoly.addOverlay(createMarker(addresses[wnum][i][3],addresses[wnum][i][2]));
  }
}

function bindDOMSingle(id,domevent,mapevent){
  GEvent.addDomListener(document.getElementById(id), domevent, function(){
    mapPoly.clearOverlays();
    mapPoly.addOverlay(ward1);
    mapPoly.addOverlay(ward2);
    mapPoly.addOverlay(ward3);
    mapPoly.addOverlay(ward4);
    mapPoly.addOverlay(ward5);
    mapPoly.addOverlay(ward6);
    mapPoly.addOverlay(ward7);
    mapPoly.addOverlay(ward8);
    eval(mapevent);
  });
}

function addWardEvents() {
  for(var i=1;i <= 8;i++){
	  if (isIE)
            {

	eval('GEvent.addListener(ward'+i+',"mouseover",function(){document.getElementsByTagName("shape")[ward'+i+'.index].title = ward'+i+'.name;})');
            }
else
{
	  eval('GEvent.addListener(ward'+i+',"mouseover",function(){document.getElementsByTagName("path")[ward'+i+'.index].setAttribute("title", ward'+i+'.name);});');
}
	  
eval('GEvent.addListener(ward'+i+',"mouseout",function(){ward'+i+'.setFillStyle({color:"#003D90", opacity:0.2});});');
eval('GEvent.addListener(ward'+i+',"click",function(){wclick(ward'+i+','+i+',w'+i+'lat,w'+i+'lng,w'+i+'zm);});');
}
}


function mapInfo(id){
  var x = document.getElementById('mapInfo').getElementsByTagName('div');
  for (i=0;i<x.length;i++){
    x[i].style.display = 'none';
  }
  if (String(id).substring(8,0) == 'mapLinks'){
    document.getElementById(id).style.display = 'block';
  } else {
    document.getElementById('mapInfoAddress'+id).style.display = 'block';
  }
}

// this is what happens when you click a ward
function wclick(wobj,wnum,lat,lng,zoom){
  mapPoly.clearOverlays();
  mapPoly.addOverlay(ward1);
  mapPoly.addOverlay(ward2);
  mapPoly.addOverlay(ward3);
  mapPoly.addOverlay(ward4);
  mapPoly.addOverlay(ward5);
  mapPoly.addOverlay(ward6);
  mapPoly.addOverlay(ward7);
  mapPoly.addOverlay(ward8);
  addWardEvents();
  GEvent.clearListeners(wobj);
  for(var i=1;i<=8;i++){
    showWard(eval('ward'+i));
  }
  mapPoly.panTo(new GLatLng(lat,lng));
  window.setTimeout(function() {
    mapPoly.setZoom(zoom);
    hideWard(wobj);
    mapInfo('mapLinksw'+wnum+'s1');
    var end;
    if(addresses[wnum].length < 9){
      end = addresses[wnum].length;
    } else {
      end = 9;
    }
    addMarkers(wnum,0,end);
    document.getElementById('restoreLink').style.display = 'block';
  }, 1000);
}

// sets all style elements of the given ward object to be transparent
function hideWard(wobj){
  wobj.setFillStyle(fColorFocus,fOpacityFocus);
}

// resets all style elements of the given ward object
function showWard(wobj){
  wobj.setFillStyle(fColorStart,fOpacityStart);
}

function clearWardListeners(){
  GEvent.clearListeners(ward1);
  GEvent.clearListeners(ward2);
  GEvent.clearListeners(ward3);
  GEvent.clearListeners(ward4);
  GEvent.clearListeners(ward5);
  GEvent.clearListeners(ward6);
  GEvent.clearListeners(ward7);
  GEvent.clearListeners(ward8);
}

// this defines and draws the actual ward objects onto the map
function polyMap(div){
  
  // create a new map
  mapPoly = newMap('mapPoly');
  
  // draw ward 1
  var ward1pts = new Array();
  ward1pts.push (new GLatLng(38.934938,-77.047741)); // Beach Rd NW and Piney Branch Parkway NW
  ward1pts.push (new GLatLng(38.936000,-77.045016)); // Piney Branch Parkway NW
  ward1pts.push (new GLatLng(38.936100,-77.041283)); // Piney Branch Parkway NW
  ward1pts.push (new GLatLng(38.938103,-77.036519)); // Piney Branch Parkway NW and 16th St NW
  ward1pts.push (new GLatLng(38.937369,-77.036390)); // 16th St NW and Spring Rd NW
  ward1pts.push (new GLatLng(38.937335,-77.033815)); // Spring Rd NW and Spring Pl NW
  ward1pts.push (new GLatLng(38.935299,-77.025876)); // Spring Rd NW and Rock Creek Church Rd NW
  ward1pts.push (new GLatLng(38.936501,-77.024202)); // New Hampshire Ave NW and Rock Creek Church Rd NW
  ward1pts.push (new GLatLng(38.937308,-77.019010)); // Rock Creek Church Rd NW and 5th St NW
  ward1pts.push (new GLatLng(38.934264,-77.019181)); // Park Pl NW and Newton Pl NW
  ward1pts.push (new GLatLng(38.928155,-77.017765)); // Columbia Rd NW and Harvard St NW
  ward1pts.push (new GLatLng(38.926252,-77.014160)); // Michigan Ave NW next to Children's National Medical Center
  ward1pts.push (new GLatLng(38.916769,-77.008967)); // Rhode Island Ave NE and N Capitol St NE
  ward1pts.push (new GLatLng(38.913731,-77.017808)); // Rhode Island Ave NW and New Jersey Ave NW
  ward1pts.push (new GLatLng(38.914666,-77.018108)); // Flordia Ave NW and New Jersey Ave NW
  ward1pts.push (new GLatLng(38.916369,-77.021971)); // Georgia Ave NW and Flordia Ave NW
  ward1pts.push (new GLatLng(38.914065,-77.021842)); // S St NW and 7th St NW
  ward1pts.push (new GLatLng(38.914098,-77.032013)); // S St NW and 14th St NW
  ward1pts.push (new GLatLng(38.917070,-77.032056)); // U St NW and 14th St NW
  ward1pts.push (new GLatLng(38.916970,-77.041197)); // U St NW and Flodia Ave NW
  ward1pts.push (new GLatLng(38.914299,-77.046132)); // Flordia Ave NW and Connecticut Ave NW
  ward1pts.push (new GLatLng(38.915935,-77.046304)); // Columbia Rd NW and Connecticut Ave NW
  ward1pts.push (new GLatLng(38.918506,-77.047720)); // Kalorama Rd NW and Connecticut Ave NW
  ward1pts.push (new GLatLng(38.919007,-77.048965)); // Belmont Rd NW and Connecticut Ave NW
  ward1pts.push (new GLatLng(38.930358,-77.055659)); // National Zoological Park NW and Connecticut Ave NW
  ward1pts.push (new GLatLng(38.932361,-77.053728)); // In the zoo between Connecticut St NW and Porter St NW
  ward1pts.push (new GLatLng(38.933329,-77.050123)); // Klingle Rd NW and Rock Creek Parkway
  ward1pts.push (new GLatLng(38.934938,-77.047741)); // Beach Rd NW and Piney Branch Parkway NW
  ward1 = new GPolygon(ward1pts,bColorStart,bWeightStart,bOpacityStart,fColorStart,fOpacityStart);
  ward1.name = "Ward 1";
  ward1.index = 0;
  mapPoly.addOverlay(ward1);

  
  // draw ward 2
  var ward2pts = new Array();
  ward2pts.push (new GLatLng(38.921611,-77.050500)); // Connecticut Ave NW and Rock Creek Parkway
  ward2pts.push (new GLatLng(38.920142,-77.051969)); // Rock Creek Parkway
  ward2pts.push (new GLatLng(38.919608,-77.054071)); // Rock Creek Parkway
  ward2pts.push (new GLatLng(38.918840,-77.055316)); // Rock Creek Parkway
  ward2pts.push (new GLatLng(38.917638,-77.058105)); // Massachusetts Ave NW and Rock Creek Parkway
  ward2pts.push (new GLatLng(38.918706,-77.059650)); // Massachusetts Ave NW and 30th St NW
  ward2pts.push (new GLatLng(38.918639,-77.066174)); // Observatory Circle NW (south point of circle)
  ward2pts.push (new GLatLng(38.916903,-77.068362)); // Whitehaven Parkway NW and Wisconsin Ave NW
  ward2pts.push (new GLatLng(38.917805,-77.069478)); // Wisconsin Ave NW and 35th St NW
  ward2pts.push (new GLatLng(38.916669,-77.069521)); // Whitehaven Parkway NW and 35th St NW
  ward2pts.push (new GLatLng(38.916536,-77.074928)); // a point in Whitehaven Park
  ward2pts.push (new GLatLng(38.917137,-77.076001)); // a point in Whitehaven Park
  ward2pts.push (new GLatLng(38.917304,-77.081323)); // Northwestern tip of Ward 2
  ward2pts.push (new GLatLng(38.909223,-77.077761)); // Whitehaven Park on western border of ward 2
  ward2pts.push (new GLatLng(38.906985,-77.077975)); // Whitehaven Park on western border of ward 2
  ward2pts.push (new GLatLng(38.902377,-77.078362)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.901441,-77.075057)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.901108,-77.072611)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.900807,-77.069778)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.899170,-77.067804)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.897534,-77.067375)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.891488,-77.064586)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.890787,-77.063985)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.890219,-77.064071)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.889451,-77.064500)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.881567,-77.059565)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.880431,-77.058320)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.880264,-77.055745)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.876255,-77.051497)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.874050,-77.051625)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.871945,-77.050552)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.871243,-77.049179)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.872279,-77.046218)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.874919,-77.047076)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.875553,-77.046089)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.869907,-77.039480)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.865229,-77.037721)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.864026,-77.038236)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.863491,-77.042313)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.862422,-77.040510)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.862689,-77.039781)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.863191,-77.039695)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.863124,-77.038107)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.861052,-77.037721)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.860939,-77.036819)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.855325,-77.033043)); // along the western border of DC/Virginia
  ward2pts.push (new GLatLng(38.850221,-77.032340)); // Southwestern Intersection of Wards 2 and 8, DC/Virginia border
  ward2pts.push (new GLatLng(38.856800,-77.020941)); // tip of East Potomac Park
  ward2pts.push (new GLatLng(38.869226,-77.020426)); // 1st bend of East branch of Potomac river next to East Potomac Park (South to North)
  ward2pts.push (new GLatLng(38.875909,-77.024117)); // 2nd bend of East branch of Potomac river next to East Potomac Park (South to North)
  ward2pts.push (new GLatLng(38.881054,-77.029953)); // SW Freeway and East branch of Potomac River
  ward2pts.push (new GLatLng(38.882256,-77.027893)); // SW Freeway and Maine Ave SW
  ward2pts.push (new GLatLng(38.882590,-77.013302)); // bend in SW Freeway
  ward2pts.push (new GLatLng(38.881588,-77.009096)); // SW Freeway and S Capitol St SW
  ward2pts.push (new GLatLng(38.892062,-77.008946)); // Constitution Ave NW and N Capitol St NW (if they intersected)
  ward2pts.push (new GLatLng(38.892029,-77.017272)); // Constitution Ave NW and Pennsylvania Ave NW
  ward2pts.push (new GLatLng(38.893949,-77.024031)); // Pennsylvania Ave NW and 9th St NW
  ward2pts.push (new GLatLng(38.896120,-77.024052)); // 9th St NW and E St NW
  ward2pts.push (new GLatLng(38.896171,-77.019954)); // 6th St NW and E St NW
  ward2pts.push (new GLatLng(38.903602,-77.019911)); // 6th St NW and New York Ave NW
  ward2pts.push (new GLatLng(38.904888,-77.016177)); // 4th St NW and New York Ave NW
  ward2pts.push (new GLatLng(38.907259,-77.016156)); // N St NW and 4th St NW
  ward2pts.push (new GLatLng(38.907245,-77.015458)); // N St NW and New Jersey Ave NW
  ward2pts.push (new GLatLng(38.914666,-77.018108)); // Flordia Ave NW and New Jersey Ave NW
  ward2pts.push (new GLatLng(38.916369,-77.021971)); // Georgia Ave NW and Flordia Ave NW
  ward2pts.push (new GLatLng(38.914065,-77.021842)); // S St NW and 7th St NW
  ward2pts.push (new GLatLng(38.914098,-77.032013)); // S St NW and 14th St NW
  ward2pts.push (new GLatLng(38.917070,-77.032056)); // U St NW and 14th St NW
  ward2pts.push (new GLatLng(38.916970,-77.041197)); // U St NW and Flodia Ave NW
  ward2pts.push (new GLatLng(38.914299,-77.046132)); // Flordia Ave NW and Connecticut Ave NW
  ward2pts.push (new GLatLng(38.915935,-77.046304)); // Columbia Rd NW and Connecticut Ave NW
  ward2pts.push (new GLatLng(38.918506,-77.047720)); // Kalorama Rd NW and Connecticut Ave NW
  ward2pts.push (new GLatLng(38.919007,-77.048965)); // Belmont Rd NW and Connecticut Ave NW
  ward2pts.push (new GLatLng(38.921611,-77.050500)); // Connecticut Ave NW and Rock Creek Parkway
  ward2 = new GPolygon(ward2pts,bColorStart,bWeightStart,bOpacityStart,fColorStart,fOpacityStart);
//  ward20 = new GPolygon(ward2pts,bColorStart,bWeightStart,bOpacityStart,fColorStart,fOpacityStart);
  ward2.name = "Ward 2";
  ward2.index = 1;
  mapPoly.addOverlay(ward2);
  
  // draw ward 3
  var ward3pts = new Array();
  ward3pts.push (new GLatLng(38.902377,-77.078362)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.902319,-77.078858)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.902348,-77.079059)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.902430,-77.079225)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.902312,-77.080196)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.902348,-77.080706)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.902438,-77.080813)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.902488,-77.080891)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.902413,-77.081073)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.902428,-77.081248)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.902336,-77.081451)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.902436,-77.081666)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.902378,-77.082709)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.902563,-77.083565)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.902661,-77.084445)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.902703,-77.085153)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.903095,-77.086816)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.904198,-77.089745)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.905740,-77.092963)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.907647,-77.096375)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.908177,-77.096981)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.908253,-77.097384)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.908403,-77.097480)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.908447,-77.097695)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.908648,-77.097770)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.908981,-77.098264)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.909048,-77.098392)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.909148,-77.098274)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.909290,-77.098542)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.909733,-77.098789)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.910392,-77.099744)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.910607,-77.099894)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.910724,-77.100211)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.910907,-77.100264)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.911341,-77.100897)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.912064,-77.102373)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.912443,-77.102555)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.912769,-77.102893)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.912990,-77.103226)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.913216,-77.103306)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.913587,-77.103295)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.914217,-77.103446)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.915190,-77.103848)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.917031,-77.104931)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.917657,-77.105538)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.918183,-77.105645)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.921277,-77.108231)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.923147,-77.110977)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.925150,-77.113338)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.926352,-77.114024)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.927287,-77.114882)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.928445,-77.116170)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.928929,-77.116427)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.929480,-77.116513)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.932234,-77.117758)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.933719,-77.119045)); // along the western border of DC/Virginia
  ward3pts.push (new GLatLng(38.934287,-77.119925)); // Western-most point of DC
  ward3pts.push (new GLatLng(38.971797,-77.071495)); // Western Ave and Broad Branch Rd NW
  ward3pts.push (new GLatLng(38.969707,-77.070208)); // Broad Branch Rd NW and Rittenhouse St NW
  ward3pts.push (new GLatLng(38.958529,-77.065229)); // Broad Branch Rd NW and 32nd St NW
  ward3pts.push (new GLatLng(38.957895,-77.062011)); // Broad Branch Rd NW and 31st St NW
  ward3pts.push (new GLatLng(38.957651,-77.059436)); // Broad Branch Rd between 31st St NW and 27th St NW
  ward3pts.push (new GLatLng(38.956727,-77.057633)); // Broad Branch Rd and 27th St NW
  ward3pts.push (new GLatLng(38.958395,-77.056217)); // 27th St NW between Broad Branch Rd NW and Military Rd NW
  ward3pts.push (new GLatLng(38.961065,-77.056174)); // 27th St NW and Military Rd NW
  ward3pts.push (new GLatLng(38.961966,-77.051153)); // Military Rd NW 1st bend in road just East of Oregon Ave NW
  ward3pts.push (new GLatLng(38.960331,-77.047548)); // Military Rd NW 2nd bend in road just East of Oregon Ave NW
  ward3pts.push (new GLatLng(38.960831,-77.044458)); // Military Rd NW and Joyce Rd NW
  ward3pts.push (new GLatLng(38.960237,-77.042570)); // Joyce Rd NW between Military Rd NW and Beach Dr NW
  ward3pts.push (new GLatLng(38.960637,-77.041926)); // Joyce Rd NW and Beach Rd NW
  ward3pts.push (new GLatLng(38.959653,-77.040210)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.958385,-77.041132)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.957751,-77.041969)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.956282,-77.042141)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.954597,-77.041905)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.952545,-77.044244)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.951293,-77.044673)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.950459,-77.045424)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.949808,-77.046604)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.948273,-77.046368)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.948139,-77.045703)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.948323,-77.045166)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.948106,-77.044287)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.946904,-77.045360)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.945836,-77.046154)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.945836,-77.047806)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.944818,-77.048514)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.944166,-77.049608)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.943316,-77.049479)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.938443,-77.051733)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.937859,-77.051346)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.937675,-77.050209)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.937675,-77.048514)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.937091,-77.047656)); // Beach Dr NW (long winding road) in Rock Creek park
  ward3pts.push (new GLatLng(38.934938,-77.047741)); // Beach Dr NW and Piney Branch Parkway NW
  ward3pts.push (new GLatLng(38.933329,-77.050123)); // Klingle Rd NW and Rock Creek Parkway
  ward3pts.push (new GLatLng(38.932361,-77.053728)); // In the zoo between Connecticut St NW and Porter St NW
  ward3pts.push (new GLatLng(38.930358,-77.055659)); // National Zoological Park NW and Connecticut Ave NW  
  ward3pts.push (new GLatLng(38.921611,-77.050500)); // Connecticut Ave NW and Rock Creek Parkway
  ward3pts.push (new GLatLng(38.920142,-77.051969)); // Rock Creek Parkway
  ward3pts.push (new GLatLng(38.919608,-77.054071)); // Rock Creek Parkway
  ward3pts.push (new GLatLng(38.918840,-77.055316)); // Rock Creek Parkway
  ward3pts.push (new GLatLng(38.917638,-77.058105)); // Massachusetts Ave NW and Rock Creek Parkway
  ward3pts.push (new GLatLng(38.918706,-77.059650)); // Massachusetts Ave NW and 30th St NW
  ward3pts.push (new GLatLng(38.918639,-77.066174)); // Observatory Circle NW (south point of circle)
  ward3pts.push (new GLatLng(38.916903,-77.068362)); // Whitehaven Parkway NW and Wisconsin Ave NW
  ward3pts.push (new GLatLng(38.917805,-77.069478)); // Wisconsin Ave NW and 35th St NW
  ward3pts.push (new GLatLng(38.916669,-77.069521)); // Whitehaven Parkway NW and 35th St NW
  ward3pts.push (new GLatLng(38.916536,-77.074928)); // a point in Whitehaven Park
  ward3pts.push (new GLatLng(38.917137,-77.076001)); // a point in Whitehaven Park
  ward3pts.push (new GLatLng(38.917304,-77.081323)); // Northwestern tip of Ward 2
  ward3pts.push (new GLatLng(38.909223,-77.077761)); // Whitehaven Park on western border of ward 2
  ward3pts.push (new GLatLng(38.906985,-77.077975)); // Whitehaven Park on western border of ward 2
  ward3pts.push (new GLatLng(38.902377,-77.078362)); // along the western border of DC/Virginia
  ward3 = new GPolygon(ward3pts,bColorStart,bWeightStart,bOpacityStart,fColorStart,fOpacityStart);
  //ward30 = new GPolygon(ward3pts,bColorStart,bWeightStart,bOpacityStart,fColorStart,fOpacityStart);
  ward3.name = "Ward 3";
  ward3.index = 2;
  mapPoly.addOverlay(ward3);
  
  // draw ward 4
  var ward4pts = new Array();
  ward4pts.push (new GLatLng(38.937308,-77.019010)); // Rock Creek Church Rd NW and 5th St NW
  ward4pts.push (new GLatLng(38.937742,-77.017508)); // Rock Creek Church Rd NW and Quincy St NW
  ward4pts.push (new GLatLng(38.939828,-77.015233)); // Rock Creek Church Rd NW and 3rd St NW
  ward4pts.push (new GLatLng(38.941097,-77.014332)); // Rock Creek Church Rd NW and Taylor St NW
  ward4pts.push (new GLatLng(38.942665,-77.012701)); // Rock Creek Church Rd NW between Upshur St NW and Varnum St NW
  ward4pts.push (new GLatLng(38.943867,-77.012122)); // Rock Creek Church Rd NW between Webster St NW and Varnum St NW
  ward4pts.push (new GLatLng(38.945813,-77.008882)); // Rock Creek Church Rd NW and Allison St NW
  ward4pts.push (new GLatLng(38.947038,-77.008538)); // Rock Creek Church Rd NW, N Capitol St NE, Hawaii Ave NE
  ward4pts.push (new GLatLng(38.954758,-77.009010)); // N Capitol St NE, Missouri St NE, Riggs Rd NE
  ward4pts.push (new GLatLng(38.956193,-77.001629)); // Riggs Rd NE and South Dakota Ave NE
  ward4pts.push (new GLatLng(38.955225,-77.000170)); // South Dakota Ave NE and Kennedy St NE
  ward4pts.push (new GLatLng(38.956760,-76.998453)); // Kennedy St NE and Chillum Pl NE
  ward4pts.push (new GLatLng(38.957194,-76.997337)); // Kennedy St NE and 6th St NE
  ward4pts.push (new GLatLng(38.957294,-76.991801)); // Kennedy St NE and Eastern Ave (DC border)
  ward4pts.push (new GLatLng(38.995078,-77.041004)); // E Beach Dr NW and Verbena St NW (Northern most point of DC)
  ward4pts.push (new GLatLng(38.971797,-77.071495)); // Western Ave and Broad Branch Rd NW
  ward4pts.push (new GLatLng(38.969707,-77.070208)); // Broad Branch Rd NW and Rittenhouse St NW
  ward4pts.push (new GLatLng(38.958529,-77.065229)); // Broad Branch Rd NW and 32nd St NW
  ward4pts.push (new GLatLng(38.957895,-77.062011)); // Broad Branch Rd NW and 31st St NW
  ward4pts.push (new GLatLng(38.957651,-77.059436)); // Broad Branch Rd between 31st St NW and 27th St NW
  ward4pts.push (new GLatLng(38.956727,-77.057633)); // Broad Branch Rd and 27th St NW
  ward4pts.push (new GLatLng(38.958395,-77.056217)); // 27th St NW between Broad Branch Rd NW and Military Rd NW
  ward4pts.push (new GLatLng(38.961065,-77.056174)); // 27th St NW and Military Rd NW
  ward4pts.push (new GLatLng(38.961966,-77.051153)); // Military Rd NW 1st bend in road just East of Oregon Ave NW
  ward4pts.push (new GLatLng(38.960331,-77.047548)); // Military Rd NW 2nd bend in road just East of Oregon Ave NW
  ward4pts.push (new GLatLng(38.960831,-77.044458)); // Military Rd NW and Joyce Rd NW
  ward4pts.push (new GLatLng(38.960237,-77.042570)); // Joyce Rd NW between Military Rd NW and Beach Dr NW
  ward4pts.push (new GLatLng(38.960637,-77.041926)); // Joyce Rd NW and Beach Rd NW
  ward4pts.push (new GLatLng(38.959653,-77.040210)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.958385,-77.041132)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.957751,-77.041969)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.956282,-77.042141)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.954597,-77.041905)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.952545,-77.044244)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.951293,-77.044673)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.950459,-77.045424)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.949808,-77.046604)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.948273,-77.046368)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.948139,-77.045703)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.948323,-77.045166)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.948106,-77.044287)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.946904,-77.045360)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.945836,-77.046154)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.945836,-77.047806)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.944818,-77.048514)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.944166,-77.049608)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.943316,-77.049479)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.938443,-77.051733)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.937859,-77.051346)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.937675,-77.050209)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.937675,-77.048514)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.937091,-77.047656)); // Beach Dr NW (long winding road) in Rock Creek park
  ward4pts.push (new GLatLng(38.934938,-77.047741)); // Beach Dr NW and Piney Branch Parkway NW
  ward4pts.push (new GLatLng(38.936000,-77.045016)); // Piney Branch Parkway NW
  ward4pts.push (new GLatLng(38.936100,-77.041283)); // Piney Branch Parkway NW
  ward4pts.push (new GLatLng(38.938103,-77.036519)); // Piney Branch Parkway NW and 16th St NW
  ward4pts.push (new GLatLng(38.937369,-77.036390)); // 16th St NW and Spring Rd NW
  ward4pts.push (new GLatLng(38.937335,-77.033815)); // Spring Rd NW and Spring Pl NW
  ward4pts.push (new GLatLng(38.935299,-77.025876)); // Spring Rd NW and Rock Creek Church Rd NW
  ward4pts.push (new GLatLng(38.936501,-77.024202)); // New Hampshire Ave NW and Rock Creek Church Rd NW
  ward4pts.push (new GLatLng(38.937308,-77.019010)); // Rock Creek Church Rd NW and 5th St NW
  ward4 = new GPolygon(ward4pts,bColorStart,bWeightStart,bOpacityStart,fColorStart,fOpacityStart);
//  ward40 = new GPolygon(ward4pts,bColorStart,bWeightStart,bOpacityStart,fColorStart,fOpacityStart);
  ward4.name = "Ward 4";
  ward4.index = 3;
  mapPoly.addOverlay(ward4);
  
  // draw ward 5
  var ward5pts = new Array();
  ward5pts.push (new GLatLng(38.918393,-76.942105)); // Northeastern intersection of wards 5 and 7, New York Ave and Anacostia River, DC/Maryland border
  ward5pts.push (new GLatLng(38.915167,-76.946204)); // 1st bend in Anacostia River (East to West)
  ward5pts.push (new GLatLng(38.914599,-76.953242)); // 2nd bend in Anacostia River (East to West)
  ward5pts.push (new GLatLng(38.911226,-76.954229)); // 3rd bend in Anacostia River (East to West)
  ward5pts.push (new GLatLng(38.907920,-76.956933)); // 4th bend in Anacostia River (East to West)
  ward5pts.push (new GLatLng(38.899972,-76.962168)); // 5th bend in Anacostia River (East to West)
  ward5pts.push (new GLatLng(38.897033,-76.961954)); // Anacostia River and Benning Rd NE
  ward5pts.push (new GLatLng(38.897601,-76.969421)); // Benning Rd NE and Oklahoma Ave NE
  ward5pts.push (new GLatLng(38.898536,-76.974185)); // Benning Rd NE and 21st St NE
  ward5pts.push (new GLatLng(38.900160,-76.983433)); // Florida Ave NE, Maryland Ave NE, H St NE, Bladensburg Rd NE, Benning Rd NE
  ward5pts.push (new GLatLng(38.908895,-77.004654)); // Flordia Ave NE and New York Ave NE
  ward5pts.push (new GLatLng(38.905706,-77.013602)); // Kirby St NW and New York Ave NW
  ward5pts.push (new GLatLng(38.907225,-77.013624)); // N St NW and Kirby St NW
  ward5pts.push (new GLatLng(38.907245,-77.015458)); // N St NW and New Jersey Ave NW
  ward5pts.push (new GLatLng(38.913731,-77.017808)); // Rhode Island Ave NW and New Jersey Ave NW
  ward5pts.push (new GLatLng(38.916769,-77.008967)); // Rhode Island Ave NE and N Capitol St NE
  ward5pts.push (new GLatLng(38.926252,-77.014160)); // Michigan Ave NW next to Children's National Medical Center
  ward5pts.push (new GLatLng(38.928155,-77.017765)); // Columbia Rd NW and Harvard St NW
  ward5pts.push (new GLatLng(38.934264,-77.019181)); // Park Pl NW and Newton Pl NW
  ward5pts.push (new GLatLng(38.937308,-77.019010)); // Rock Creek Church Rd NW and 5th St NW
  ward5pts.push (new GLatLng(38.937742,-77.017508)); // Rock Creek Church Rd NW and Quincy St NW
  ward5pts.push (new GLatLng(38.939828,-77.015233)); // Rock Creek Church Rd NW and 3rd St NW
  ward5pts.push (new GLatLng(38.941097,-77.014332)); // Rock Creek Church Rd NW and Taylor St NW
  ward5pts.push (new GLatLng(38.942665,-77.012701)); // Rock Creek Church Rd NW between Upshur St NW and Varnum St NW
  ward5pts.push (new GLatLng(38.943867,-77.012122)); // Rock Creek Church Rd NW between Webster St NW and Varnum St NW
  ward5pts.push (new GLatLng(38.945813,-77.008882)); // Rock Creek Church Rd NW and Allison St NW
  ward5pts.push (new GLatLng(38.947038,-77.008538)); // Rock Creek Church Rd NW, N Capitol St NE, Hawaii Ave NE
  ward5pts.push (new GLatLng(38.954758,-77.009010)); // N Capitol St NE, Missouri St NE, Riggs Rd NE
  ward5pts.push (new GLatLng(38.956193,-77.001629)); // Riggs Rd NE and South Dakota Ave NE
  ward5pts.push (new GLatLng(38.955225,-77.000170)); // South Dakota Ave NE and Kennedy St NE
  ward5pts.push (new GLatLng(38.956760,-76.998453)); // Kennedy St NE and Chillum Pl NE
  ward5pts.push (new GLatLng(38.957194,-76.997337)); // Kennedy St NE and 6th St NE
  ward5pts.push (new GLatLng(38.957294,-76.991801)); // Kennedy St NE and Eastern Ave (DC border)
  ward5pts.push (new GLatLng(38.918393,-76.942105)); // Northeastern intersection of wards 5 and 7, New York Ave and Anacostia River, DC/Maryland border
  ward5 = new GPolygon(ward5pts,bColorStart,bWeightStart,bOpacityStart,fColorStart,fOpacityStart);
  //ward50 = new GPolygon(ward5pts,bColorStart,bWeightStart,bOpacityStart,fColorStart,fOpacityStart);  
  ward5.name = "Ward 5";
  ward5.index = 4;
  mapPoly.addOverlay(ward5);
  
  // draw ward 6
  var ward6pts = new Array();
  ward6pts.push (new GLatLng(38.898536,-76.974185)); // Benning Rd NE and 21st St NE
  ward6pts.push (new GLatLng(38.897166,-76.974185)); // 21st St NE and Gales St NE
  ward6pts.push (new GLatLng(38.894628,-76.974914)); // 21st St NE and D St NE
  ward6pts.push (new GLatLng(38.894628,-76.974914)); // 21st St NE and C St NE
  ward6pts.push (new GLatLng(38.892089,-76.971996)); // C St NE and RFK Stadium
  ward6pts.push (new GLatLng(38.889785,-76.968648)); // RFK Stadium and E Capitol St SE
  ward6pts.push (new GLatLng(38.889785,-76.963413)); // E Capitol St SE and Anacostia River
  ward6pts.push (new GLatLng(38.886411,-76.965344)); // 6th bend in Anacostia River (East to West)
  ward6pts.push (new GLatLng(38.882937,-76.970108)); // 7th bend in Anacostia River (East to West)
  ward6pts.push (new GLatLng(38.878326,-76.973155)); // 8th bend in Anacostia River (East to West)
  ward6pts.push (new GLatLng(38.876686,-76.977682)); // Pennsylvania Ave SE and Anacostia River
  ward6pts.push (new GLatLng(38.869736,-76.992788)); // 3rd bend in Anacostia River (West to East)
  ward6pts.push (new GLatLng(38.870939,-77.002745)); // 2nd bend in Anacostia River (West to East)
  ward6pts.push (new GLatLng(38.863856,-77.008581)); // 1st bend in Anacostia River (West to East)
  ward6pts.push (new GLatLng(38.856800,-77.020941)); // tip of East Potomac Park
  ward6pts.push (new GLatLng(38.869226,-77.020426)); // 1st bend of East branch of Potomac river next to East Potomac Park (South to North)
  ward6pts.push (new GLatLng(38.875909,-77.024117)); // 2nd bend of East branch of Potomac river next to East Potomac Park (South to North)
  ward6pts.push (new GLatLng(38.881054,-77.029953)); // SW Freeway and East branch of Potomac River
  ward6pts.push (new GLatLng(38.882256,-77.027893)); // SW Freeway and Maine Ave SW
  ward6pts.push (new GLatLng(38.882590,-77.013302)); // bend in SW Freeway
  ward6pts.push (new GLatLng(38.881588,-77.009096)); // SW Freeway and S Capitol St SW
  ward6pts.push (new GLatLng(38.892062,-77.008946)); // Constitution Ave NW and N Capitol St NW (if they intersected)
  ward6pts.push (new GLatLng(38.892029,-77.017272)); // Constitution Ave NW and Pennsylvania Ave NW
  ward6pts.push (new GLatLng(38.893949,-77.024031)); // Pennsylvania Ave NW and 9th St NW
  ward6pts.push (new GLatLng(38.896120,-77.024052)); // 9th St NW and E St NW
  ward6pts.push (new GLatLng(38.896171,-77.019954)); // 6th St NW and E St NW
  ward6pts.push (new GLatLng(38.903602,-77.019911)); // 6th St NW and New York Ave NW
  ward6pts.push (new GLatLng(38.904888,-77.016177)); // 4th St NW and New York Ave NW
  ward6pts.push (new GLatLng(38.907259,-77.016156)); // N St NW and 4th St NW
  ward6pts.push (new GLatLng(38.907225,-77.013624)); // N St NW and Kirby St NW
  ward6pts.push (new GLatLng(38.905706,-77.013602)); // Kirby St NW and New York Ave NW
  ward6pts.push (new GLatLng(38.908895,-77.004654)); // Flordia Ave NE and New York Ave NE
  ward6pts.push (new GLatLng(38.900160,-76.983433)); // Florida Ave NE, Maryland Ave NE, H St NE, Bladensburg Rd NE, Benning Rd NE
  ward6pts.push (new GLatLng(38.898536,-76.974185)); // Benning Rd NE and 21st St NE
  ward6 = new GPolygon(ward6pts,bColorStart,bWeightStart,bOpacityStart,fColorStart,fOpacityStart);
  ward6.name = "Ward 6";
  ward6.index = 5;
  mapPoly.addOverlay(ward6);
  
  // draw ward 7
  var ward7pts = new Array();
  ward7pts.push (new GLatLng(38.876686,-76.977682)); // Pennsylvania Ave SE and Anacostia River
  ward7pts.push (new GLatLng(38.872713,-76.968949)); // Pennsylvania Ave SE and 27th St SE
  ward7pts.push (new GLatLng(38.869439,-76.968992)); // 27th St SE and R St SE
  ward7pts.push (new GLatLng(38.869339,-76.978948)); // Minnesota Ave SE and R St SE
  ward7pts.push (new GLatLng(38.866566,-76.984441)); // Minnesota Ave SE and Good Hope Rd SE
  ward7pts.push (new GLatLng(38.865463,-76.978261)); // 1830 Good Hope Rd SE
  ward7pts.push (new GLatLng(38.863024,-76.972811)); // Good Hope Rd SE and Altamont Pl SE
  ward7pts.push (new GLatLng(38.864160,-76.970751)); // Altamont Pl SE and Naylor Rd SE
  ward7pts.push (new GLatLng(38.860283,-76.968305)); // Good Hope Rd SE and Naylor Rd SE
  ward7pts.push (new GLatLng(38.857944,-76.967919)); // Naylor Rd SE and Denver St SE
  ward7pts.push (new GLatLng(38.851862,-76.962125)); // Naylor Rd SE and Southern Ave SE
  ward7pts.push (new GLatLng(38.892812,-76.909318)); // Eastern-most point of DC border
  ward7pts.push (new GLatLng(38.918393,-76.942105)); // Northeastern intersection of wards 5 and 7, New York Ave and Anacostia River, DC/Maryland border
  ward7pts.push (new GLatLng(38.915167,-76.946204)); // 1st bend in Anacostia River (East to West)
  ward7pts.push (new GLatLng(38.914599,-76.953242)); // 2nd bend in Anacostia River (East to West)
  ward7pts.push (new GLatLng(38.911226,-76.954229)); // 3rd bend in Anacostia River (East to West)
  ward7pts.push (new GLatLng(38.907920,-76.956933)); // 4th bend in Anacostia River (East to West)
  ward7pts.push (new GLatLng(38.899972,-76.962168)); // 5th bend in Anacostia River (East to West)
  ward7pts.push (new GLatLng(38.897033,-76.961954)); // Anacostia River and Benning Rd NE
  ward7pts.push (new GLatLng(38.897601,-76.969421)); // Benning Rd NE and Oklahoma Ave NE
  ward7pts.push (new GLatLng(38.898536,-76.974185)); // Benning Rd NE and 21st St NE
  ward7pts.push (new GLatLng(38.897166,-76.974185)); // 21st St NE and Gales St NE
  ward7pts.push (new GLatLng(38.894628,-76.974914)); // 21st St NE and D St NE
  ward7pts.push (new GLatLng(38.894628,-76.974914)); // 21st St NE and C St NE
  ward7pts.push (new GLatLng(38.892089,-76.971996)); // C St NE and RFK Stadium
  ward7pts.push (new GLatLng(38.889785,-76.968648)); // RFK Stadium and E Capitol St SE
  ward7pts.push (new GLatLng(38.889785,-76.963413)); // E Capitol St SE and Anacostia River
  ward7pts.push (new GLatLng(38.886411,-76.965344)); // 6th bend in Anacostia River (East to West)
  ward7pts.push (new GLatLng(38.882937,-76.970108)); // 7th bend in Anacostia River (East to West)
  ward7pts.push (new GLatLng(38.878326,-76.973155)); // 8th bend in Anacostia River (East to West)
  ward7pts.push (new GLatLng(38.876686,-76.977682)); // Pennsylvania Ave SE and Anacostia River
  ward7 = new GPolygon(ward7pts,bColorStart,bWeightStart,bOpacityStart,fColorStart,fOpacityStart);
  ward7.name = "Ward 7";
  ward7.index = 6;
  mapPoly.addOverlay(ward7);
  
  // draw ward 8
  var ward8pts = new Array();
  ward8pts.push (new GLatLng(38.850221,-77.032340)); // Southwestern Intersection of Wards 2 and 8, DC/Virginia border
  ward8pts.push (new GLatLng(38.863856,-77.008581)); // 1st bend in Anacostia River (West to East)
  ward8pts.push (new GLatLng(38.870939,-77.002745)); // 2nd bend in Anacostia River (West to East)
  ward8pts.push (new GLatLng(38.869736,-76.992788)); // 3rd bend in Anacostia River (West to East)
  ward8pts.push (new GLatLng(38.876686,-76.977682)); // Pennsylvania Ave SE and Anacostia River
  ward8pts.push (new GLatLng(38.872713,-76.968949)); // Pennsylvania Ave SE and 27th St SE
  ward8pts.push (new GLatLng(38.869439,-76.968992)); // 27th St SE and R St SE
  ward8pts.push (new GLatLng(38.869339,-76.978948)); // Minnesota Ave SE and R St SE
  ward8pts.push (new GLatLng(38.866566,-76.984441)); // Minnesota Ave SE and Good Hope Rd SE
  ward8pts.push (new GLatLng(38.865463,-76.978261)); // 1830 Good Hope Rd SE
  ward8pts.push (new GLatLng(38.863024,-76.972811)); // Good Hope Rd SE and Altamont Pl SE
  ward8pts.push (new GLatLng(38.864160,-76.970751)); // Altamont Pl SE and Naylor Rd SE
  ward8pts.push (new GLatLng(38.860283,-76.968305)); // Good Hope Rd SE and Naylor Rd SE
  ward8pts.push (new GLatLng(38.857944,-76.967919)); // Naylor Rd SE and Denver St SE
  ward8pts.push (new GLatLng(38.851862,-76.962125)); // Naylor Rd SE and Southern Ave SE
  ward8pts.push (new GLatLng(38.791398,-77.038751)); // Southwestern Intersection of DC/Maryland/Virginia
  ward8pts.push (new GLatLng(38.800630,-77.039008)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.814742,-77.035832)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.815679,-77.038150)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.818567,-77.038917)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.819487,-77.038853)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.819980,-77.039797)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.820741,-77.039861)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.821326,-77.039389)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.821919,-77.039786)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.822245,-77.040687)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.823148,-77.040966)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.824217,-77.038944)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.829867,-77.037699)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.832274,-77.039287)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.833779,-77.042120)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.833377,-77.042720)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.831505,-77.041991)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.831271,-77.043064)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.833712,-77.044094)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.840264,-77.045295)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.839227,-77.040017)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.840130,-77.034523)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.845344,-77.032807)); // Point on DC/Virginia border
  ward8pts.push (new GLatLng(38.850221,-77.032340)); // Southwestern Intersection of Wards 2 and 8, DC/Virginia border
  ward8 = new GPolygon(ward8pts,bColorStart,bWeightStart,bOpacityStart,fColorStart,fOpacityStart);
  ward8.name = "Ward 8";
  ward8.index = 7;
  mapPoly.addOverlay(ward8);
  
  for (var i=1; i<addresses.length; i++) {
    if (i == 3) {
      continue;
    } else {
      for (var j=0; j<addresses[i].length; j++) {
        bindDOMSingle('mapListing'+addresses[i][j][2],'click','mapPoly.setCenter(addresses['+i+']['+j+'][3]);mapPoly.addOverlay(createMarker(addresses['+i+']['+j+'][3],addresses['+i+']['+j+'][2]));mapInfo(addresses['+i+']['+j+'][2]);');
      }
    }
  }
  
  addWardEvents();
}

function makeMaps(){
  polyMap();
}

