// JavaScript Document
	var map;
	var mm;
	function myHood(name, lat, long){
		this.name = name;
		this.lat = lat;
		this.long = long;
		
		function showHood(){
			alert("d");
		}
		this.showHood = showHood;

	}
	
	var test = new myHood("name","lat","long");
	test.showHood;
	//alert (new myHood("name","lat","long").lat);
	function createMarker(point, HTML, icon) {
		var marker = new PdMarker(point, icon);
		//mm.addMarker(marker,13,17); 
		
		marker.setTooltip(HTML);
		//var html = "Visit <a href='http://www.yourvancouver.com'>Vancouver<\/a>";
		
		marker.setOpacity(100);
		
		GEvent.addListener(marker, "mouseover", function() {
			marker.showTooltip();
		});
		GEvent.addListener(marker, "mouseout", function() {
			marker.hideTooltip();
		});

		return marker;
	}

function GonLoad() {
  if (GBrowserIsCompatible()) {

	map = new GMap2(document.getElementById("map"));
	map.setCenter(new GLatLng(42.3510, -71.0673), 15);
			map.addControl(new GLargeMapControl());
			map.addControl(new GMapTypeControl());
			mm = new GMarkerManager(map);
			
			//GEvent.addListener(map, "zoomend", mm.refresh);
			
			var neslIcon = new GIcon();
			neslIcon.image = "http://www.nesl.edu/images/mapTack.png";
			neslIcon.iconSize = new GSize(15, 26);
			neslIcon.iconAnchor = new GPoint(7, 26);
			neslIcon.infoWindowAnchor = new GPoint(5, 1);
			
			var tIcon = new GIcon();
			tIcon.image = "http://www.nesl.edu/images/tIcon.png";
			tIcon.iconSize = new GSize(20, 20);
			tIcon.iconAnchor = new GPoint(10, 10);
			tIcon.infoWindowAnchor = new GPoint(5, 1);

			var pIcon = new GIcon();
			pIcon.image = "http://www.nesl.edu/images/pIcon.png";
			pIcon.iconSize = new GSize(20, 20);
			pIcon.iconAnchor = new GPoint(10, 10);
			pIcon.infoWindowAnchor = new GPoint(5, 1);

			var hIcon = new GIcon();
			hIcon.image = "http://www.nesl.edu/images/hIcon.png";
			hIcon.iconSize = new GSize(20, 20);
			hIcon.iconAnchor = new GPoint(10, 10);
			hIcon.infoWindowAnchor = new GPoint(5, 1);

			//nesl admin1
			point = new GLatLng(42.349383, -71.068586);
			windowHTML = "<strong>New England Law | Boston Administrative Offices<br />46 Church Street</strong><br />Dean's Office, Registrar, Financial Aid, Law Review and Journals";
			map.addOverlay(createMarker(point,windowHTML,neslIcon));
			
			//nesl admin2
			point = new GLatLng(42.350814,-71.071431);
			windowHTML = "<strong>New England Law | Boston Administrative Offices<br />31 Saint James Avenue</strong><br />Admissions, Career Services, Academic Centers";
			map.addOverlay(createMarker(point,windowHTML,neslIcon));
			
			//nesl main bldg
			point = new GLatLng(42.350814, -71.066340);
			windowHTML = "<strong>New England Law | Boston<br />154 Stuart Street</strong><br />Classrooms, Library, Faculty Offices";
			map.addOverlay(createMarker(point,windowHTML,neslIcon));
			
			//bookstore
			point = new GLatLng(42.350322, -71.061416);
			windowHTML = "<strong>Tufts Health Sciences Bookstore</strong><br/>(Serving New England Law | Boston)";
			map.addOverlay(createMarker(point,windowHTML,neslIcon));

			//parking
			point = new GLatLng(42.350623, -71.066973);
			windowHTML = "Radisson Hotel Parking";
			map.addOverlay(createMarker(point,windowHTML,pIcon));
			
			
			/////////////////////////////////////////////////////////////////////  neighborhoods
			var ctown = new TLabel();
			ctown.id = 'chinatown';
			ctown.content = '<p style="width:100px;"><strong>Chinatown</strong></p>';
			ctown.anchorLatLng = new GLatLng (42.352518,-71.060386);
			map.addTLabel(ctown);
			
			var bbay = new TLabel();
			bbay.id = 'backBay';
			bbay.content = '<p style="width:100px;"><strong>Back Bay</strong></p>';
			bbay.anchorLatLng = new GLatLng (42.350806,-71.086092);
			map.addTLabel(bbay);

			var bayvill = new TLabel();
			bayvill.id = 'bayVillage';
			bayvill.content = '<p style="width:100px;"><strong>Bay Village</strong></p>';
			bayvill.anchorLatLng = new GLatLng (42.348015,-71.067724);
			map.addTLabel(bayvill);

			var allston = new TLabel();
			allston.id = 'allston';
			allston.content = '<p style="width:150px;"><strong>Allston/Brighton</strong></p>';
			allston.anchorLatLng = new GLatLng (42.351947,-71.157761);
			map.addTLabel(allston);

			var beacon = new TLabel();
			beacon.id = 'beacon';
			beacon.content = '<p style=" width:130px; "><strong>Beacon Hill</strong></p>';
			beacon.anchorLatLng = new GLatLng (42.358417,-71.069012);
			map.addTLabel(beacon);

			var downtown = new TLabel();
			downtown.id = 'downtown';
			downtown.content = '<p style=" width:130px; "><strong>Downtown Boston</strong></p>';
			downtown.anchorLatLng = new GLatLng (42.356641,-71.058197);
			map.addTLabel(downtown);

			var fenway = new TLabel();
			fenway.id = 'fenway';
			fenway.content = '<p style="width:130px; "><strong>Fenway/ Kenmore</strong></p>';
			fenway.anchorLatLng = new GLatLng (42.348142,-71.098537);
			map.addTLabel(fenway);

			var jamaica = new TLabel();
			jamaica.id = 'jamaica';
			jamaica.content = '<p style="width:130px; "><strong>Jamaica Plain</strong></p>';
			jamaica.anchorLatLng = new GLatLng (42.316797,-71.110554);
			map.addTLabel(jamaica);

			var northEnd = new TLabel();
			northEnd.id = 'northEnd';
			northEnd.content = '<p style="width:130px;"><strong>North End</strong></p>';
			northEnd.anchorLatLng = new GLatLng (42.366281,-71.054764);
			map.addTLabel(northEnd);

			var southEnd = new TLabel();
			southEnd.id = 'southEnd';
			southEnd.content = '<p style="width:130px; "><strong>South End</strong></p>';
			southEnd.anchorLatLng = new GLatLng (42.334438,-71.084461);
			map.addTLabel(southEnd);

			var southie = new TLabel();
			southie.id = 'southie';
			southie.content = '<p style="width:130px; "><strong>South Boston</strong></p>';
			southie.anchorLatLng = new GLatLng (42.335200,-71.046867);
			map.addTLabel(southie);
			
			var brookline = new TLabel();
			brookline.id = 'brookline';
			brookline.content = '<p style="width:130px; "><strong>Brookline</strong></p>';
			brookline.anchorLatLng = new GLatLng (42.326443,-71.142998);
			map.addTLabel(brookline);

  }
}

function showLabel(id){
	var labels = new Array()
	labels[0] = 'chinatown';
	labels[1] = 'backBay';
	labels[2] = 'bayVillage';
	labels[3] = 'beacon';
	labels[4] = 'allston';
	labels[5] = 'downtown';
	labels[6] = 'fenway';
	labels[7] = 'jamaica';
	labels[8] = 'northEnd';
	labels[9] = 'southie';
	labels[10] = 'southEnd';
	labels[11] = 'brookline';
	
	for (i=0;i<labels.length;i++){
		if(id != labels[i]){
			$(labels[i]).style.visibility = 'hidden';
		}
	}
	//alert($("map").getElementsByTagName("p").length);
	$(id).style.visibility = 'visible';
	//alert(id);

}
function hideLabel(id){
ele = $(id);
window.setTimeout("ele.style.visibility = 'hidden'",2500);


}
