 //<![CDATA[

function Lab(lat, lng, name, link, address, room, access) {
	this.lat = lat;
	this.lng = lng;
	this.name = name;
	this.link = link;
	this.address = address;
	this.room = room;
	this.access = access;
}
var labs = new Array(
	new Lab(41.869138,-87.674698, 'Benjamin Goldberg Research Center', 'grc','1940 West Taylor Street','Rooms 105A, 105B','Building access required after hours'),

	new Lab(41.870411,-87.6485, 'Science and Engineering Labs East', 'sele','950 South Halsted Street','Rooms 2058, 2249, 2249F, 2263, 2265','Building access required after hours'),

	new Lab(41.874329,-87.657082, 'Student Services Building', 'ssb','1200 West Harrison Street','Room 2300',''),

	new Lab(41.874313,-87.652007, 'Behavioral Sciences Building', 'bsb','1007 West Harrison Street','B001, 4133','Priority use of 4133 given to Sociology students'),

	new Lab(41.8688,-87.6678, 'SPHPI', 'sphpi','1601 West Taylor Street','Room B34','Priority use of labs given to SPH students'),

	new Lab(41.871231,-87.673771, 'Student Residence Hall', 'srh','818 South Wolcott','Room 317','Open to residents only'),

	new Lab(41.874346,-87.648033, 'Art and Architecture', 'aa','845 West Harrison Street','Rooms B510, 2312','Priority use of labs given to A&A students'),

	new Lab(41.871990,-87.646940, 'Student Center East', 'sce','701 South Halsted Street','Rooms 401, 408',''),

	new Lab(41.873567,-87.647158, 'Student Residence and Commons', 'src','700 South Halsted Street','Room 2027',''),

	new Lab(41.869499,-87.649135, 'Science and Engineering South', 'ses','845 West Taylor Street','Rooms 201, 205B, 205C',''),

	new Lab(41.864770,-87.647213, 'Marie Robinson Hall', 'mrh','811 West Maxwell Street','Room 156','Open to residents only'),

	new Lab(41.865343,-87.647013, 'Thomas Beckham Hall', 'tbh','1250 South Halsted Street','Rooms 181, 183','Open to residents only'),

	new Lab(41.871646,-87.651140, 'Daley Library', 'lib','801 South Morgan Street','Room 1444',''),

	new Lab(41.874406,-87.653315, 'Education, Performing Arts, and Social Work', 'epasw','1040 West Harrison Street','Room L270','Priority use of lab given to CBA students'),

	new Lab(41.870962,-87.650521, 'Science and Engineering Offices', 'seo','851 South Morgan Street','Rooms 200, 430','Priority use of labs given to Math students')

	);

function load() {
    if (GBrowserIsCompatible()) {
      var map = new GMap2(document.getElementById("map"));

	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	map.addControl(new GScaleControl());
	map.addControl(new GOverviewMapControl());
	map.setCenter(new GLatLng(41.869800,-87.659091), 15);

	// Creates a marker at the given point with the given number label
	function createMarker(point, name, link, address, room, access) {
  	  var marker = new GMarker(point);
  	  GEvent.addListener(marker, "click", function() {
    	  marker.openInfoWindowHtml("<div class='info'><a href='" + link + "/'>" + name + "</a><br />" + address + "<br /><div class='tiny'>" + room + "<br />" + access + "</div></div>");
  	  });

	  return marker;
	}
	
	// Overlays lab markers 
	for( var i = 0; i < labs.length; i++) {
		map.addOverlay(createMarker(new GLatLng(labs[i].lat,labs[i].lng), labs[i].name, labs[i].link, labs[i].address,  labs[i].room, labs[i].access));
	}

    }
  }

  //]]>
