// JavaScript Document
    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/   
    // http://econym.googlepages.com/index.htm


	 //The custom icon
	 var logoIcon2 = new GIcon();
      logoIcon2.image = "overlay_images/logo.png";
      logoIcon2.iconSize = new GSize(20, 24);
      logoIcon2.iconAnchor = new GPoint(10, 12);
      logoIcon2.infoWindowAnchor = new GPoint(14, 8);
	  
	 var logoIcon = new GIcon();
      logoIcon.image = "overlay_images/newlogo.png";
      logoIcon.iconSize = new GSize(20, 16);
      logoIcon.iconAnchor = new GPoint(10, 8);
      logoIcon.infoWindowAnchor = new GPoint(10, 1);
	
	 // A function to create the marker and set up the event window
	 function createMarker(point,name,html) {
        var marker = new GMarker(point,logoIcon);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        // save the info for roll-overs
        gmarkers[i] = marker;
        i++;
        return marker;
      }
	  
	  // create the map
	  
    if (GBrowserIsCompatible()) {
     	 
      // this variable will collect the html which will eventually be placed in the side_bar
      var side_bar_html = "";
    
      // arrays to hold copies of the markers and html used by the side_bar
      // because the function closure trick doesnt work there
      var gmarkers = [];
      var i = 0;


      var map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		//map.addControl(new GMapTypeControl());
        
		//map.addControl(new GLargeMapControl());
		map.setCenter(new GLatLng(42.287215, -83.725433), 13);
		
	  // === Set up the map types exactly like Google Maps ===
      // Add the Terrain Map Type
      map.addMapType(G_PHYSICAL_MAP);
	 	map.setMapType(G_PHYSICAL_MAP);
      // Create a Hierercical map type control
      var hierarchy = new GHierarchicalMapTypeControl();
      // make Google Satellite Hybrid be the satellite default
      hierarchy.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, null, true);
      // add that control to the map
      map.addControl(hierarchy);
		
	  // add the points for Betsy Barbour
	  var point = new GLatLng(42.27729289775552, -83.7414863705635);
      var marker = createMarker(point,"Betsy Barbour House",'<div class="infoBox"><img src="barbour/barbour.jpg" height="94px" width="142px" /><span><b>Betsy Barbour House</b><br />420 S. State<br />Ann Arbor, MI 48109-1328</span></div>')
      map.addOverlay(marker);	  
	  //Insert an overlay 
	  var insert1=new EInsert(new GLatLng(42.27726, -83.74145), "overlay_images/betsybarbour.png", new GSize(234,111),19);
	  map.addOverlay(insert1);	
	  
	  // Cambridge (no overlay)
	  var point = new GLatLng(42.27485581040651, -83.74156951904297);
      var marker = createMarker(point,"Cambridge House",'<div class="infoBox"><img src="cambridge/cambridge.jpg" height="94px" width="142px" /><span><b>Cambridge House</b><br />541 Thompson St.<br />Ann Arbor, MI 48109-1360</span></div>')
      map.addOverlay(marker);
	  
	  // East Quad
      var point = new GLatLng(42.273069611622006, -83.73499542474747);
      var marker = createMarker(point,"East Quadrangle",'<div class="infoBox"><img src="eastquad/eastquad.jpg" height="94px" width="142px" /><span><b>East Quadrangle</b><br />701 E. University<br />Ann Arbor, MI 48109-1245</span></div>')
      map.addOverlay(marker);	  
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.27294, -83.73499942474747), "overlay_images/EQ.png", new GSize(165,374),18);
	  map.addOverlay(insert1);
	  
	  //Fletcher
	  var point = new GLatLng(42.27017288498238, -83.74266922473907);
      var marker = createMarker(point,"Fletcher Hall",'<div class="infoBox"><img src="fletcher/fletcher.jpg" height="94px" width="142px" /><span><b>Fletcher Hall</b><br />915 Sybil<br />Ann Arbor, MI 48109-3298</span></div>')
      map.addOverlay(marker);	  
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.27016, -83.74264), "overlay_images/fletcher.png", new GSize(207,74),19);
	  map.addOverlay(insert1);
	  
	  //Newberry
	  var point = new GLatLng(42.27692773757575, -83.74147295951843);
      var marker = createMarker(point,"Helen Newberry House",'<div class="infoBox"><img src="newberry/newberry.jpg" height="94px" width="142px" /><span><b>Helen Newberry House</b><br />432 S. State<br />Ann Arbor, MI 48109-1329</span></div>')
      map.addOverlay(marker);	  
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.276945, -83.74145), "overlay_images/helennewberry.png", new GSize(235,99),19);
	  map.addOverlay(insert1);
	  
	  //South Quad
      var point = new GLatLng(42.27371066434297, -83.74203622341156);
      var marker = createMarker(point,"South Quadrangle",'<div class="infoBox"><img src="southquad/southquad.jpg" height="94px" width="142px" /><span><b>South Quadrangle</b><br />600 E. Madison<br />Ann Arbor, MI 48109-1372</span></div>')
      map.addOverlay(marker);
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.27374026434297, -83.74206622341156), "overlay_images/SouthQuad_OverLay.png", new GSize(600,293),19);
	  map.addOverlay(insert1);
	  
	  //West Quad	  
	  var point = new GLatLng(42.2749, -83.74233);
      var marker = createMarker(point,"West Quadrangle",'<div class="infoBox"><img src="westquad/westquad.jpg" height="94px" width="142px" /><span><b>West Quadrangle</b><br />541 Thompson<br />Ann Arbor, MI 48109-1360</span></div>')
      map.addOverlay(marker);	  	  
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.2749, -83.74233), "overlay_images/wq.png", new GSize(232,290),18);
	  map.addOverlay(insert1);
	  
	  //Couzens	  
	  var point = new GLatLng(42.28197, -83.732576);
      var marker = createMarker(point,"Couzens Hall",'<div class="infoBox"><img src="couzens/couzens.jpg" height="94px" width="142px" /><span><b>Couzens Hall</b><br />1300 E. Ann<br />Ann Arbor, MI 48109-2050</span></div>')
      map.addOverlay(marker);	  	  
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.2819, -83.73265), "overlay_images/couzens.png", new GSize(525,235),19);
	  map.addOverlay(insert1);
	  
	  //Alice Lloyd	  
	  var point = new GLatLng(42.28127, -83.73155);
      var marker = createMarker(point,"Alice Lloyd Hall",'<div class="infoBox"><img src="alicelloyd/alicelloyd.jpg" height="94px" width="142px" /><span><b>Alice Lloyd Hall</b><br />100 Observatory<br />Ann Arbor, MI 48109-2025</span></div>')
      map.addOverlay(marker);	  	  
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.28127, -83.73155), "overlay_images/alicelloyd.png", new GSize(286,449),19);
	  map.addOverlay(insert1);
	  
	  //Markley
	  var point = new GLatLng(42.28091, -83.72880);
      var marker = createMarker(point,"Mary Markley Hall",'<div class="infoBox"><img src="markley/markley.jpg" height="94px" width="142px" /><span><b>Mary Markley Hall</b><br />1503 Washington Heights<br />Ann Arbor, MI 48109-2015</span></div>')
      map.addOverlay(marker);	  	  
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.28092, -83.72880), "overlay_images/markley.png", new GSize(372,189),18);
	  map.addOverlay(insert1);
	  
	  //Mosher-Jordan	  
	  var point = new GLatLng(42.28006, -83.731393);
      var marker = createMarker(point,"Mosher-Jordan Hall",'<div class="infoBox"><img src="mojo/mojo.jpg" height="94px" width="142px" /><span><b>Mosher-Jordan Hall</b><br />200 Observatory<br />Ann Arbor, MI 48109-2035</span></div>')
      map.addOverlay(marker);	  	  
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.28006, -83.73145), "overlay_images/mojo.png", new GSize(102,333),18);
	  map.addOverlay(insert1);
	  
	  //Hill Dining Center	  
	  var point = new GLatLng(42.2801, -83.7315);
      var marker = createMarker(point,"Hill Dining Center",'<div class="infoBox"><img src="hdc/hdc.jpg" height="94px" width="142px" /><span><b>Hill Dining Center</b><br />200 Observatory<br />Ann Arbor, MI 48109-2035</span></div>')
      map.addOverlay(marker);
	  
	  //Oxford	  
	  var point = new GLatLng(42.27473, -83.72525);
      var marker = createMarker(point,"Oxford Housing",'<div class="infoBox"><img src="oxford/oxford.jpg" height="94px" width="142px" /><span><b>Oxford Housing</b><br />627 Oxford<br />Ann Arbor, MI 48109-2634</span></div>')
      map.addOverlay(marker);	  	  
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.27473, -83.72525), "overlay_images/oxford.png", new GSize(212,381),18);
	  map.addOverlay(insert1);
	  
	  //Stockwell	  
	  var point = new GLatLng(42.27892, -83.73168);
      var marker = createMarker(point,"Stockwell Hall",'<div class="infoBox"><img src="stockwell/stockwell.jpg" height="94px" width="142px" /><span><b>Stockwell Hall</b><br />324 Observatory<br />Ann Arbor, MI 48109-2040</span></div>')
      map.addOverlay(marker);	  	  
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.2789, -83.73175), "overlay_images/stockwell.png", new GSize(396,375),19);
	  map.addOverlay(insert1);
	  
	  //Baits I House	  
	  var point = new GLatLng(42.29172, -83.72285);
      var marker = createMarker(point,"Baits I House",'<div class="infoBox"><img src="baits/baits.jpg" height="94px" width="142px" /><span><b>Baits I House</b><br /> 	1230 Hubbard<br />Ann Arbor, MI 48109-2082</span></div>')
      map.addOverlay(marker);	  	  
	  //Insert an overlay of Baits I
	  var insert1=new EInsert(new GLatLng(42.29172, -83.72285), "overlay_images/baits1.png", new GSize(231,534),18);
	  map.addOverlay(insert1);
	  
	  //Baits II  
	  var point = new GLatLng(42.293925, -83.72384);
      var marker = createMarker(point,"Baits II House",'<div class="infoBox"><img src="baits/baits.jpg" height="94px" width="142px" /><span><b>Baits II House</b><br />1440 Hubbard<br />Ann Arbor, MI 48109-2083</span></div>')
      map.addOverlay(marker);	  	  
	  //Insert an overlay of Baits II
	  var insert1=new EInsert(new GLatLng(42.293925, -83.72384), "overlay_images/baits2.png", new GSize(481,295),18);
	  map.addOverlay(insert1);
	  
	  //Bursley	  
	  var point = new GLatLng(42.2937, -83.7208);
      var marker = createMarker(point,"Bursley Hall",'<div class="infoBox"><img src="bursley/bursley.jpg" height="94px" width="142px" /><span><b>Bursley Hall</b><br />1931 Duffield St.<br />Ann Arbor, MI 48109-2080</span></div>')
      map.addOverlay(marker);	  
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.29375, -83.7208), "overlay_images/bursley.png", new GSize(598,335),18);
	  map.addOverlay(insert1);
	  
	  //Northwood III	  
	  var point = new GLatLng(42.2967, -83.7180);
      var marker = createMarker(point,"Northwood III Apartments",'<div class="infoBox"><img src="../northwood3/overview/northwood3welcome.jpg" height="94px" width="142px" /><span><b>Northwood III Apartments</b><br />&nbsp;<br />&nbsp;</span></div>')
      map.addOverlay(marker);	  
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.29667, -83.71805), "overlay_images/nw3.png", new GSize(262,377),17);
	  map.addOverlay(insert1);
	  
	  //Henderson House	  
	  var point = new GLatLng(42.27184, -83.73164);
      var marker = createMarker(point,"Henderson House",'<div class="infoBox"><img src="henderson/henderson2.jpg" height="94px" width="142px" /><span><b>Henderson House</b><br />1330 Hill St.<br />Ann Arbor, MI</span></div>')
      map.addOverlay(marker);
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.27184, -83.73164), "overlay_images/henderson.png", new GSize(115,237),20);
	  map.addOverlay(insert1);
	  
	  //Lawyers Club
	  var point = new GLatLng(42.2747, -83.7393);
      var marker = createMarker(point,"Lawyers Club",'<div class="infoBox"><img src="lawyersclub/lawyersclub.jpg" height="94px" width="142px" /><span><b>Lawyers Club</b><br />551 South State St.<br />Ann Arbor, MI</span></div>')
      map.addOverlay(marker);
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.27443, -83.7393), "overlay_images/lawyersclub.png", new GSize(767,401),19);
	  map.addOverlay(insert1);
	  
	  //Martha Cook
	  var point = new GLatLng(42.27457, -83.737844);
      var marker = createMarker(point,"Martha Cook Building",'<div class="infoBox"><img src="marthacook/marthacook.jpg" height="94px" width="142px" /><span><b>Martha Cook Building</b><br />906 S. University<br />Ann Arbor, MI 48109-1195</span></div>')
      map.addOverlay(marker);
	  //Insert an overlay
	  var insert1=new EInsert(new GLatLng(42.2745, -83.73780), "overlay_images/marthacook.png", new GSize(145,316),19);
	  map.addOverlay(insert1);

      //North Quad
	  var point = new GLatLng(42.28077, -83.739016);
      var marker = createMarker(point,"North Quadrangle",'<div class="infoBox"><img src="northquad/northquad.jpg" height="94px" width="142px" /><span><b>North Quadrangle</b><br />105 South State St.<br />Ann Arbor, MI 48109</span></div>')
      map.addOverlay(marker);	  	  
	  //Insert an overlay
	  //var insert1=new EInsert(new GLatLng(42.28077, -83.739016), "overlay_images/wq.png", new GSize(232,290),18);
	  //map.addOverlay(insert1);
    }

    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }
    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/   
    // http://econym.googlepages.com/index.htm