// JavaScript Document
<!-- // hide script from browser
 //<![CDATA[

    // Check to see if this browser can run the Google API
if (GBrowserIsCompatible()) 
{
	var gmarkers = [];
	var index = 0;
    var htmls = [];
    var to_htmls = [];
    var from_htmls = [];
    var i=0;
	var side_bar_html = "";
	var parkSW = 0;
	var keepSide = 0;
	var swAllMarked = 0;
	var refer = document.referrer; 
	//alert(refer);
	   
	// Create a base icon for all of our markers that specifies the
    // shadow, icon dimensions, etc.
    var baseIcon = new GIcon();
    
	//baseIcon.shadow = "http://www.wfu.edu/~murphytj/images/markerWFUs.png";
    baseIcon.iconSize = new GSize(22, 30);
    //baseIcon.shadowSize = new GSize(65, 68);
    baseIcon.iconAnchor = new GPoint(3, 25);
    baseIcon.infoWindowAnchor = new GPoint(9, 2);
    baseIcon.infoShadowAnchor = new GPoint(18, 75);
	
	function setStart()
	{
		
		if (refer.search(/murphytj/) > -1)
		{
			changeMap("36.13118333", "-80.27948333333", "<br><b>Tommy Murphy<br>Instructional Technology Consultant<br>Chemistry Department</b><br>My office is located in: Salem Hall room 205,<br>Phone: 336 758 4717<br>","Chemistry Department", "Salem Hall", "b");
		}
		else if (refer.search(/calloway.wfu.edu/) > -1)
		{
			loadBldg("7");
		}
		else
		{
					
			//grab refering page URL string starting at position 19 (should crop off "http://www.wfu.edu/")
			//and continue until the next occurence of slash mark.
			var myRefer = refer.substring(19, refer.indexOf("/",20));
			//alert(myRefer);
			switch(myRefer)
			{
				case "chemistry":
					//self serving section to create Chemistry department marker
					loadBldg("3");
					break;
				case "physics":
					//self serving section to create Chemistry department marker
					loadBldg("5");
					break;
				case "biology":
					//self serving section to create Chemistry department marker
					loadBldg("4");
					break;
				case "psychology":
					//self serving section to create Chemistry department marker
					loadBldg("11");
					break;
				case "philosophy":
					//self serving section to create Chemistry department marker
					loadBldg("9");
					break;
				case "politics":
					//self serving section to create Chemistry department marker
					loadBldg("9");
					break;
				case "anthropology":
					//self serving section to create Chemistry department marker
					loadBldg("13");
					break;
				default:
					//add spinner
					vpoint = new GLatLng(36.134366, -80.278404);
					var vmarker = WFicon(vpoint,"http://www.wfu.edu/chemistry/tools/images/wfuSpinner.gif"); 
				    map.addOverlay(vmarker);
					break;
	
	
			}   
		}
		
		
	}
		
	//function to open email without having address in body of html
	function emailThis(address)
	{
		EAddress = "mailto:" + address + "\@wfu.edu";
		document.location.href=EAddress;
	}
	
	function parkSwitch(latC, lngC)
	{
		if (swAllMarked == 1)
		{
			map.clearOverlays();
			swAllMarked = 0;
		}
		
		if (parkSW == 0)
		{
			map.clearOverlays();			
			parkSW = 1;
		}
		
		if (latC != "" && lngC != "")
		{
			map.setCenter(new GLatLng(latC, lngC), 16);
		}
	}
	
	function changeAthletic(athLocate)  //function activated by athletic select box
	{
		if (swAllMarked == 1)
		{
			map.clearOverlays();
			swAllMarked = 0;
		}
		
		var html = "";
		//var locate = document.form1.athleticList.value; 
		switch (athLocate)
		{
			case "1":
				html = "<br>Manchester Athletic Center / Pruitt Football Center";
				changeMap("36.133968", "-80.275321", html, "", "", "")
				break;
			case "2":
				html = "<br>Reynolds Gymnasium<br><a href=\"#\" onclick=\"readALL(\'\',\'Reynolds Gym\',\'b\')\">Directory</a>";
				changeMap("36.134602", "-80.276045", html, "", "", "")
				break;
			case "3":
				html = "<br>Miller Center";
				changeMap("36.134195", "-80.274433", html, "", "", "")
				break;
			case "4":
				html = "<br>Tennis Courts";
				changeMap("36.136028", "-80.274511", html, "", "", "")
				break;
			case "5":
				html = "<br>Spry Soccer Stadium";
				changeMap("36.138478", "-80.279488", html, "", "", "")
				break;
			case "6":
				html = "<br>Haddock Golf Center";
				changeMap("36.133035", "-80.273350", html, "", "", "")
				break;
			case "7":
				html = "<br>Hooks Baseball Stadium";
				changeMap("36.131353", "-80.271612", html, "", "", "")
				break;
			case "8":
				html = "<br>Leighton Tennis Stadium";
				changeMap("36.135039", "-80.276552", html, "", "", "")
				break;
			case "9":
				html = "<br>Kentner Stadium";
				changeMap("36.134996", "-80.275222", html, "", "", "")
				break;
			case "10":
				html = "<br>Water Tower Field";
				changeMap("36.136580", "-80.273324", html, "", "", "")
				break;
			case "11":
				html = "<br>Poteat Field";
				changeMap("36.136172", "-80.277288", html, "", "", "")
				break;
			case "12":
				html = "<br>Davis Field";
				changeMap("36.132825", "-80.280340", html, "", "", "")
				break;
			case "13":
				html = "<br>Soccer Practice Field";
				changeMap("36.138468", "-80.280494", html, "", "", "")
				break;
			case "14":
				html = "<br>Football Practice Field";
				changeMap("36.133371", "-80.274511", html, "", "", "")
				break;
			case "15":
				html = "<br>Cross Country Trail";
				changeMap("36.134994", "-80.270093", html, "", "", "")
				break;
		}
		//document.form1.athleticList.selectedIndex = 0;
	}
	
	function loadBldg(myLocate)   //function activated by main building and department select box
	{
		if (swAllMarked == 1)
		{
			map.clearOverlays();
			swAllMarked = 0;
		}
		
		var html = ""
		switch (myLocate)
		{
			case "1":
				html = "<br>Starling Hall/Welcome Center"
				changeMap("36.131168", "-80.283481", html, "","","");
				break;
			case "2":
				html = "<br>Reynolda Hall";
				html +="<br><img src=\"images/reynolda.png\" width=150 height=100>";
				html += "<br><a href=\"http://www.wfu.edu/hr/\">Human Resources</a>, ";
				html += "<a href=\"http://www.wfu.edu/registrar/\">Registrar's Office</a>";
				//html += "<br><a href=\"#\" onclick=\"readALL(\'\',\'\',\'\')\">Directory</a>";
				changeMap("36.133590", "-80.277525", html, "","","")
				break;
			case "3": //readALL(dept, bldg, cond);
				html = "<br>Salem Hall<br><a href=\"http://www.wfu.edu/chemistry\">Chemistry Department</a><br>";
				html +="<img src=\"images/SalemHall-002.jpg\" width=150 height=100>";
				html +="<br><a href=\"#\" onclick=\"readALL(\'Chemistry Department\',\'Salem Hall\',\'b\')\">Directory</a>";
				changeMap("36.13118333", "-80.27948333333", html,"Chemistry Department","Salem Hall","b")
				break;
			case "4":
				html = "<br>Winston Hall<br><a href=\"http://www.wfu.edu/biology\">Biology Dept</a>";
				html +="<br><a href=\"#\" onclick=\"readALL(\'Biology Department\',\'Winston Hall\',\'b\')\">Directory</a>";
				changeMap("36.13086944", "-80.28005833333", html, "Biology Department","Winston Hall","b")
				break;
			case "5":
				html = "<br>Olin Physical Laboratory<br><a href=\"http://www.wfu.edu/physics\">Physics Dept</a>";
				html +="<br><a href=\"#\" onclick=\"readALL(\'Physics Department\',\'Olin Physical Lab\',\'b\')\">Directory</a>";
				changeMap("36.13198333333", "-80.279075", html,"Physics Department","Olin Physical Lab","b")
				break;
			case "6":
				html = "<br>Wait Chapel, Wingate Hall<br><img src=\"wait.jpg\" width=150 height=100><br>";
				html +="<a href=\"http://www.wfu.edu/religion/\">Religion</a>";
				html +="<br><a href=\"#\" onclick=\"readALL(\'\',\'Wingate Hall\',\'b\')\">Directory</a>";
				changeMap("36.135244", "-80.2791694", html, "","Wingate Hall","b")
				break;
			case "7":
				html = "<br>Wayne Calloway Center, Manchester Hall, Kirby Hall";
				html +="<br><a href=\"http://calloway.wfu.edu/\">Calloway Center</a>, ";
				html +="<a href=\"http://www.cs.wfu.edu/\">Computer Science</a>, ";
				html +="<a href=\"http://www.math.wfu.edu/\">Mathematics</a>";
				html +="<br><a href=\"#\" onclick=\"readALL(\'\',\'Kirby, Calloway, West\',\'b\')\">Directory</a>";
				//
				changeMap("36.133570", "-80.276595", html, "","Kirby, Calloway, West","b")
				break;
			case "8":
				html = "<br>Scales Fine Arts Center<br><img src=\"images/scales.jpg\" width=150 height=100>";
				html +="<br><a href=\"http://www.wfu.edu/music/\">Music Dept.</a>";
				html +="<br><a href=\"http://www.wfu.edu/theatre/\">Theatre and Dance Dept.</a>";
				html += "<br><a href=\"#\" onclick=\"readALL(\'\',\'Scales Fine Arts Center\',\'b\')\">Directory</a>";
				changeMap("36.133816", "-80.281059", html, "", "Scales Fine Arts Center","b")
				break;
			case "9":
				html = "<br>Tribble Hall<br><img src=\"images/tribble.jpg\" >";
				html +="<br><a href=\"http://www.wfu.edu/counseling/\">Counseling Dept</a>, ";
				html +="<a href=\"http://www.wfu.edu/education/\">Education Dept</a>, ";
				html +="<a href=\"http://www.wfu.edu/english\">English Dept</a>, ";
				html +="<a href=\"http://www.wfu.edu/history/\">History Dept</a>, ";
				html +="<br><a href=\"http://www.wfu.edu/philosophy/\">Philosophy Dept</a>, <a href=\"http://www.wfu.edu/politics/\">Political Science</a>, ";
				html +="<a href=\"http://www.wfu.edu/wfupress\">WFU Press</a>, ";
				html +="<br><a href=\"http://www.wfu.edu/wgs\">Women\'s & Gender Studies</a>, ";
				html += "<br><a href=\"#\" onclick=\"readALL(\'\',\'Tribble Hall\',\'b\')\">Directory</a>";
				changeMap("36.132138", "-80.277286", html, "", "Tribble Hall","b")
				break;
			case "10":
				html = "<br>Carswell Hall<br>";
				html +="Departments: <a href=\"http://www.wfu.edu/communication/\">Communications</a>, ";
				
				html +="<a href=\"http://www.wfu.edu/economics/\">Economics</a>, ";
				html +="<a href=\"http://www.wfu.edu/sociology/\">Sociology</a> ";
				
				html += "<br><a href=\"#\" onclick=\"readALL(\'\',\'Carswell Hall\',\'b\')\">Directory</a>";
				changeMap("36.132829", "-80.276083", html, "", "Carswell Hall","b")
				break;
			case "11":
				html = "<br>Greene Hall<br>";
				html += "<img src=\"images/greenehall.png\" width=150 height=100><br>";
				html += "<a href=\"http://www.wfu.edu/psychology\">Psychology Department</a>, ";
				html +=  "<br><a href=\"#\" onclick=\"readALL(\'Psychology Department\',\'Greene Hall\',\'b\')\">Directory</a>";
				changeMap("36.133264", "-80.276246", html, "Psychology Department", "Greene Hall","b")
				break;
			case "12":
				html = "<br><a href=\"http://www.wfu.edu/moa/\">Dept. of Anthropology Museum Building</a>";
				html += "<br><a href=\"#\" onclick=\"readALL(\'Museum of Anthropology\',\'Anthropology Museum\',\'b\')\">Directory</a>";
				changeMap("36.134849", "-80.274071", html, "Museum of Anthropology", "Anthropology Museum","b")
				break;
			case "13":
				html = "<br><a href=\"http://www.wfu.edu/anthropology/\">Anthropology Building</a>";
				html += "<br><a href=\"#\" onclick=\"readALL(\'Anthropology Department\',\'Anthropology Building\',\'b\')\">Directory</a>";
				changeMap("36.134553", "-80.273712", html, "Anthropology Department", "Anthropology Building","b")
				break;
			case "14":
				html = "<br>Worrell Professional Center";
				changeMap("36.137383", "-80.275198", html, "","","")
				break;
			case "15":
				html = "<br><a href=\"http://www.wfu.edu/benson/\">Benson University Center</a>";
				html +="<br><img src=\"images/benson.png\" width=150 height=100>";
				changeMap("36.132740", "-80.277883", html, "","","")
				break;
			case "16":
				html = "<br><a href=\"http://zsr.wfu.edu/\">Z. Smith Reynolds Library</a><br><img src=\"images/zsmith.jpg\" width=150 height=100>";
				html += "<br><a href=\"http://www.wfu.edu/tlc/\">Teaching & Learning Center</a>";
				html += "<br><a href=\"#\" onclick=\"readALL(\'\',\'ZSR Library\',\'b\')\">Directory</a>";
				changeMap("36.131957", "-80.278150", html, "", "ZSR Library","b")
				break;
			case "17":
				html = "<br><b>Information Systems Building</b><br> Help Desk Ph. 4357";
				html += "<br><a href=\"http://www.wfu.edu/is/\">Information Services</a>, ";
				html += "<a href=\"http://www.armyrotc.com/edu/wakeforest/index.htm\">Military Science</a>";
				html += "<br><a href=\"#\" onclick=\"readALL(\'\',\'IS Building\',\'b\')\">Directory</a>";
				changeMap("36.137992", "-80.275588", html, "", "IS Building","b")
				break;
			case "18":
				html = "<br>WFU Bookstore";
				html +="<br><img src=\"images/bookstore.png\" width=150 height=100>";
				changeMap("36.134550", "-80.279211", html, "","","")
				break;
			case "19":
				html = "<br>Post Office / UPS Store<br>PHONE: (336) 896-1126 ";
				html +="<br><img src=\"images/postoffice.png\" width=150 height=100>";
				changeMap("36.135106", "-80.278324", html, "","","")
				break;
			case "20":
				html = "<br><a href=\"http://www.deaconshop.com/\">Deacon Shop</a><br>";
				html +="<img src=\"images/deaconshop.png\" width=150 height=100>";
				changeMap("36.134445", "-80.277690", html, "","","")
				break;
			case "21":
				html = "<br>WFDD Radio Station";
				changeMap("36.135190", "-80.274221", html, "","","")
				break;
			case "22":
				html = "<br>Facilities Management<br>Phone: 4255";
				changeMap("36.132088", "-80.273361", html, "","","")
				break;
			case "23":
				html = "<br>Central Heating Plant";
				changeMap("36.132237", "-80.273754", html, "","","")
				break;
			case "24":
				html = "<br>University Police/Parking Management";
				changeMap("36.131772", "-80.273759", html, "","","")
				break;
			case "25":
				html = "<br>Univeristy Photographer";
				changeMap("36.132092", "-80.272673", html, "","","")
				break;
			case "26":
				html = "<br><a href=\"http://www1.wfubmc.edu/school\">Wake Forest University<br>School of Medicine</a>";
				changeMap("36.090275", "-80.26706388", html, "","","")
				break;
			case "27":
				html = "<br>Brendle Recital Hall";
				changeMap("36.134321", "-80.280555", html, "","","")
				break;
			case "ALL":
				//add spinner
				//readMLX("all.xml");
				readALL("","","a");
				vpoint = new GLatLng(36.134366, -80.278404);
				var vmarker = WFicon(vpoint,"http://www.wfu.edu/chemistry/tools/images/wfuSpinner.gif"); 
			    map.addOverlay(vmarker);
				break;
			case "BLDG":				
				markALL();
				readALL("","","a");
				break;
		}
	}
		
	function markALL()
	{
		map.clearOverlays();
		swAllMarked = 1;
		
		html = "<br>Reynolda Hall";
		html +="<br><img src=\"images/reynolda.png\" width=150 height=100>";
		html += "<br><a href=\"http://www.wfu.edu/hr/\">Human Resources</a>, ";
		html += "<a href=\"http://www.wfu.edu/registrar/\">Registrar's Office</a>";
		//html += "<br><a href=\"#\" onclick=\"readALL(\'\',\'\',\'\')\">Directory</a>";
		changeMap("36.133590", "-80.277525", html, "","","")	
				
		html = "<br>Salem Hall<br><a href=\"http://www.wfu.edu/chemistry\">Chemistry Department</a><br>";
		html +="<img src=\"images/SalemHall-002.jpg\" width=150 height=100>";
		html +="<br><a href=\"#\" onclick=\"readALL(\'Chemistry Department\',\'Salem Hall\',\'b\')\">Directory</a>";
		changeMap("36.13118333", "-80.27948333333", html, "","","")

		html = "<br>Winston Hall<br><a href=\"http://www.wfu.edu/biology\">Biology Dept</a>";
		html +="<br><a href=\"#\" onclick=\"readALL(\'Biology Department\',\'Winston Hall\',\'b\')\">Directory</a>";
		changeMap("36.13086944", "-80.28005833333", html, "","","")

		html = "<br>Olin Physical Laboratory<br><a href=\"http://www.wfu.edu/physics\">Physics Dept</a>";
		html +="<br><a href=\"#\" onclick=\"readALL(\'Physics Department\',\'Olin Physical Lab\',\'b\')\">Directory</a>";
		changeMap("36.13198333333", "-80.279075", html, "","Olin Physical Lab","b")

		html = "<br>Wait Chapel, Wingate Hall<br><img src=\"wait.jpg\" width=150 height=100>";
		html +="<a href=\"http://www.wfu.edu/religion/\">Religion</a>";
		html +="<br><a href=\"#\" onclick=\"readALL(\'\',\'Wingate Hall\',\'b\')\">Directory</a>";
		changeMap("36.135244", "-80.2791694", html, "","Wingate Hall","b")

		html = "<br>Wayne Calloway Center, Manchester Hall, Kirby Hall";
		html +="<br><a href=\"http://calloway.wfu.edu/\">Calloway Center</a>, ";
		html +="<a href=\"http://www.cs.wfu.edu/\">Computer Science</a>, ";
		html +="<a href=\"http://www.math.wfu.edu/\">Mathematics</a>";
		html +="<br><a href=\"#\" onclick=\"readALL(\'\',\'Kirby, Calloway, West\',\'b\')\">Directory</a>";
		changeMap("36.133570", "-80.276595", html, "","","")

		html = "<br>Scales Fine Arts Center<br><img src=\"images/scales.jpg\" width=150 height=100>";
		html +="<br><a href=\"http://www.wfu.edu/music/\">Music Dept.</a>";
		html +="<br><a href=\"http://www.wfu.edu/theatre/\">Theatre and Dance Dept.</a>";
		html += "<br><a href=\"#\" onclick=\"readALL(\'\',\'Scales Fine Arts Center\',\'b\')\">Directory</a>";
		changeMap("36.133816", "-80.281059", html, "","","")

		html = "<br>Tribble Hall<br><img src=\"images/tribble.jpg\" >";
		html +="<br><a href=\"http://www.wfu.edu/counseling/\">Counseling Dept</a>, ";
		html +="<a href=\"http://www.wfu.edu/education/\">Education Dept</a>, ";
		html +="<a href=\"http://www.wfu.edu/english\">English Dept</a>, ";
		html +="<a href=\"http://www.wfu.edu/history/\">History Dept</a>, ";
		html +="<br><a href=\"http://www.wfu.edu/philosophy/\">Philosophy Dept</a>, <a href=\"http://www.wfu.edu/politics/\">Political Science</a>, ";
		html +="<a href=\"http://www.wfu.edu/wfupress\">WFU Press</a>, ";
		html +="<br><a href=\"http://www.wfu.edu/wgs\">Women\'s & Gender Studies</a>, ";
		html += "<br><a href=\"#\" onclick=\"readALL(\'\',\'Tribble Hall\',\'b\')\">Directory</a>";
		changeMap("36.132138", "-80.277286", html, "","","")

		html = "<br>Carswell Hall<br>";
		html +="<a href=\"http://www.wfu.edu/communication/\">Communications Department</a>, ";				
		html += "<br><a href=\"#\" onclick=\"readALL(\'\',\'Carswell Hall\',\'b\')\">Directory</a>";
		changeMap("36.132829", "-80.276083", html, "","","")

		html = "<br>Greene Hall<br>";
		html += "<img src=\"images/greenehall.png\" width=150 height=100><br>";
		html += "<a href=\"http://www.wfu.edu/psychology\">Psychology Department</a>, ";
		html +=  "<br><a href=\"#\" onclick=\"readALL(\'Psychology Department\',\'Greene Hall\',\'b\')\">Directory</a>";
		changeMap("36.133264", "-80.276246", html, "","","")

		html = "<br><a href=\"http://www.wfu.edu/moa/\">Dept. of Anthropology Museum Building</a>";
		html += "<br><a href=\"#\" onclick=\"readALL(\'Museum of Anthropology\',\'Anthropology Museum\',\'b\')\">Directory</a>";
		changeMap("36.134849", "-80.274071", html, "","","")

		html = "<br><a href=\"http://www.wfu.edu/anthropology/\">Archeology Lab Building</a>";
		html += "<br><a href=\"#\" onclick=\"readALL(\'Anthropology Department\',\'Anthropology Building\',\'b\')\">Directory</a>";
		changeMap("36.134553", "-80.273712", html, "","","")

		html = "<br>Worrell Professional Center";
		changeMap("36.137383", "-80.275198", html, "","","")

		html = "<br><a href=\"http://www.wfu.edu/benson/\">Benson University Center</a>";
		changeMap("36.132740", "-80.277883", html, "","","")

		html = "<br><a href=\"http://zsr.wfu.edu/\">Z. Smith Reynolds Library</a><br><img src=\"images/zsmith.jpg\" width=150 height=100>";
		html += "<br><a href=\"http://www.wfu.edu/tlc/\">Teaching & Learning Center</a>";
		html += "<br><a href=\"#\" onclick=\"readALL(\'\',\'ZSR Library\',\'b\')\">Directory</a>";
		changeMap("36.131957", "-80.278150", html, "","","")

		html = "<br><b>Information Systems Building</b><br> Help Desk Ph. 4357";
		html += "<br><a href=\"http://www.wfu.edu/is/\">Information Services</a>, ";
		html += "<a href=\"http://www.armyrotc.com/edu/wakeforest/index.htm\">Military Science</a>";
		html += "<br><a href=\"#\" onclick=\"readALL(\'\',\'IS Building\',\'b\')\">Directory</a>";
		changeMap("36.137992", "-80.275588", html, "","","")
		
		html = "<br>WFU Bookstore";
		html +="<br><img src=\"images/bookstore.png\" width=150 height=100>";
		changeMap("36.134550", "-80.279211", html, "","","")

		html = "<br>Post Office / UPS Store<br>PHONE: (336) 896-1126 ";
		html +="<br><img src=\"images/postoffice.png\" width=150 height=100>";
		changeMap("36.135106", "-80.278324", html, "","","")

		html = "<br><a href=\"http://www.deaconshop.com/\">Deacon Shop</a>";
		html +="<img src=\"images/deaconshop.png\" width=150 height=100>";
		changeMap("36.134445", "-80.277690", html, "","","")

		html = "<br>WFDD Radio Station";
		changeMap("36.135190", "-80.274221", html, "","","")
		
		html = "<br>University Police/Parking Management";
		changeMap("36.131772", "-80.273759", html, "","","")

		html = "<br>Univeristy Photographer";
		changeMap("36.132092", "-80.272673", html, "","","")
		
		html = "<br><a href=\"http://www.wfu.edu/benson/\">Benson University Center</a>";
		html +="<br><img src=\"images/benson.png\" width=150 height=100>";
		changeMap("36.132740", "-80.277883", html, "","","")
		
		
	}
	
	function commuter()  //maps commuter parking spaces
	{
		
		parkSwitch(36.133570, -80.277638);
		parkSide();
		
		var vpoint = new GLatLng(36.131671, -80.281498);
		var vmarker = createPark(vpoint,'Commuter','<br><b>Commuter Parking</b>','http://www.wfu.edu/~murphytj/images/markerCommuter.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.136862, -80.276539);
		var vmarker = createPark(vpoint,'Commuter','<br><b>Commuter Parking</b>','http://www.wfu.edu/~murphytj/images/markerCommuter.png')
	    map.addOverlay(vmarker);
		
	}
	
	
	function year1()  //maps 1st year student parking spaces
	{
		
		parkSwitch(36.137959, -80.279656);
		parkSide();
		
		var vpoint = new GLatLng(36.141339, -80.280621);
		var vmarker = createPark(vpoint,'year1','<br><b>1st Year Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerYear1.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.140216, -80.280913);
		var vmarker = createPark(vpoint,'year1','<br><b>1st Year Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerYear1.png')
	    map.addOverlay(vmarker);
		
	}
	
	function shuttle()  //maps campus shuttle stops
	{
		
		parkSwitch(36.133570, -80.277638);
		parkSide();
				
		vpoint = new GLatLng(36.140719, -80.280831);
		var vmarker = createPark(vpoint,'Student','<br><b>Shuttle Stop</b>','http://www.wfu.edu/~murphytj/images/markerBus.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.139945, -80.278955);
		var vmarker = createPark(vpoint,'Student','<br><b>Shuttle Stop</b>','http://www.wfu.edu/~murphytj/images/markerBus.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.136286, -80.275449);
		var vmarker = createPark(vpoint,'Student','<br><b>Shuttle Stop</b>','http://www.wfu.edu/~murphytj/images/markerBus.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.137622, -80.276446);
		var vmarker = createPark(vpoint,'Student','<br><b>Shuttle Stop</b>','http://www.wfu.edu/~murphytj/images/markerBus.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.134402, -80.279826);
		var vmarker = createPark(vpoint,'Student','<br><b>Shuttle Stop</b>','http://www.wfu.edu/~murphytj/images/markerBus.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.133893, -80.275888);
		var vmarker = createPark(vpoint,'Student','<br><b>Shuttle Stop</b>','http://www.wfu.edu/~murphytj/images/markerBus.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.132918, -80.278132);
		var vmarker = createPark(vpoint,'Student','<br><b>Shuttle Stop</b>','http://www.wfu.edu/~murphytj/images/markerBus.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.131846, -80.276909);
		var vmarker = createPark(vpoint,'Student','<br><b>Shuttle Stop</b>','http://www.wfu.edu/~murphytj/images/markerBus.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.131443, -80.279956);
		var vmarker = createPark(vpoint,'Student','<br><b>Shuttle Stop</b>','http://www.wfu.edu/~murphytj/images/markerBus.png')
	    map.addOverlay(vmarker);
		
	}
	
	function callbox()  //maps all emergency call boxes
	{
		
		map.clearOverlays();
		parkSwitch(36.133570, -80.277638);
		parkSide();
		
		vpoint = new GLatLng(36.133507, -80.268208);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.131023, -80.275719);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.130902, -80.275070);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.131007, -80.276997);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.132402, -80.274996);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.132814, -80.275456);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.132022, -80.276670);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	   map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.130832, -80.279407);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);

		vpoint = new GLatLng(36.131661, -80.279365);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.132672, -80.277218);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.132860, -80.278336);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.133864, -80.277094);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.134000, -80.275965);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.134841, -80.273799);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.135477, -80.273899);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.136626, -80.274519);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);

		vpoint = new GLatLng(36.135950, -80.276038);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.135035, -80.277367);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.135667, -80.278570);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.134746, -80.279640);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.133740, -80.279671);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.131605, -80.280043);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.134877, -80.281249);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.135890, -80.280311);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.136357, -80.279317);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.137367, -80.277415);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.138036, -80.277801);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.138519, -80.274088);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.136892, -80.281091);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.136443, -80.282294);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.138381, -80.282377);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.138455, -80.281483);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.141241, -80.280625);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.140643, -80.280837);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.139683, -80.280949);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	   map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.139697, -80.278012);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.134609, -80.282111);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.132028, -80.282429);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.130910, -80.283728);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.131473, -80.281450);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.129919, -80.282672);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.130571, -80.282013);
		var vmarker = createPark(vpoint,'Student','<br><b>Call Box</b>','http://www.wfu.edu/~murphytj/images/markerCallBox.png')
	    map.addOverlay(vmarker);
		
	}
	
	function student()  //maps student/general parking spaces
	{
		
		parkSwitch(36.133570, -80.277638);
		parkSide();
				
		var vpoint = new GLatLng(36.138443, -80.283236);
		var vmarker = createPark(vpoint,'Student','<br><b>Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerStudent.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.137833, -80.282069);
		var vmarker = createPark(vpoint,'Student','<br><b>Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerStudent.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.136570, -80.282542);
		var vmarker = createPark(vpoint,'Student','<br><b>Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerStudent.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.137275, -80.281636);
		var vmarker = createPark(vpoint,'Student','<br><b>Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerStudent.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.137438, -80.280436);
		var vmarker = createPark(vpoint,'Student','<br><b>Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerStudent.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.136029, -80.280372);
		var vmarker = createPark(vpoint,'Student','<br><b>Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerStudent.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.137625, -80.277355);
		var vmarker = createPark(vpoint,'Student','<br><b>Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerStudent.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.138137, -80.276910);
		var vmarker = createPark(vpoint,'Student','<br><b>Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerStudent.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.138376, -80.274813);
		var vmarker = createPark(vpoint,'Student','<br><b>Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerStudent.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.138096, -80.274510);
		var vmarker = createPark(vpoint,'Student','<br><b>Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerStudent.png')
	    map.addOverlay(vmarker);
		
		
		vpoint = new GLatLng(36.135738, -80.273370);
		var vmarker = createPark(vpoint,'Student','<br><b>Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerStudent.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.131264, -80.275060);
		var vmarker = createPark(vpoint,'Student','<br><b>Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerStudent.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.130927, -80.276128);
		var vmarker = createPark(vpoint,'Student','<br><b>Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerStudent.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.131543, -80.275952);
		var vmarker = createPark(vpoint,'Student','<br><b>Student Parking</b>','http://www.wfu.edu/~murphytj/images/markerStudent.png')
	    map.addOverlay(vmarker);
		
	}
	
	function faculty()  //maps faculty/staff parking spaces
	{
		
		parkSwitch(36.133570, -80.277638);
		parkSide();
		
		var vpoint = new GLatLng(36.130679, -80.283326);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.131270, -80.280830);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.130603, -80.280441);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.131800, -80.279503);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.131132, -80.278530);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.131871, -80.277064);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.132558, -80.274162);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.131957, -80.274715);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.132600, -80.275250);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.134489, -80.273890);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		
		vpoint = new GLatLng(36.134950, -80.274276);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.135297, -80.273531);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.134487, -80.275563);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.134908, -80.276110);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.134923, -80.277612);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.136948, -80.273969);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.136412, -80.274943);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.136265, -80.275894);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.136768, -80.275774);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.135746, -80.278517);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.134890, -80.279951);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.134882, -80.281070);
		var vmarker = createPark(vpoint,'Faculty','<br><b>Faculty Parking</b>','http://www.wfu.edu/~murphytj/images/markerFaculty.png')
	    map.addOverlay(vmarker);
		
	}
	
	function parkSide() //loads parking spaces links into side bar
	{
		if (swAllMarked == 1)
		{
			map.clearOverlays();
			swAllMarked = 0;
		}
		parkSwitch(36.133570, -80.277638);
		document.getElementById("side_bar").innerHTML = "<img src='http://www.wfu.edu/~murphytj/images/markerVisitor.png'><a href='#' class='style10' onclick='visitor()'> Visitor Parking</a><br>";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<img src='http://www.wfu.edu/~murphytj/images/markerFaculty.png'><a href='#' class='style10' onclick='faculty()'> Faculty/Staff Parking</a><br>";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<img src='http://www.wfu.edu/~murphytj/images/markerYear1.png'><a href='#' class='style10' onclick='year1()'> 1st Year Student Parking</a><br>";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<img src='http://www.wfu.edu/~murphytj/images/markerCommuter.png'><a href='#' class='style10' onclick='commuter()'> Commuter Parking</a><br>";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<img src='http://www.wfu.edu/~murphytj/images/markerStudent.png'><a href='#' class='style10' onclick='student();'> General/Residential Parking</a><br>";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<img src='http://www.wfu.edu/~murphytj/images/markerBus.png'><a href='#' class='style10' onclick='shuttle();'> Shuttle Stops</a><br>";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<img src='http://www.wfu.edu/~murphytj/images/markerCallBox.png'><a href='#' class='style10' onclick='callbox();'> Emergency Call Box</a><br>";
	}
	
	function residentSide() //loads residence hall links into side bar
	{
		
		if (swAllMarked == 1)
		{
			map.clearOverlays();
			swAllMarked = 0;
		}
		parkSW = 0;
		map.clearOverlays();
		
		document.getElementById("side_bar").innerHTML = "<p align='left' class='style3'><span class='style9'>RESIDENCE HALLS </span></p>";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href='#' onclick=\"sideMap('36.134774', '-80.279321', '&lt;br&gt;&lt;b&gt;Efird Residence Hall&lt;/b&gt;&lt;br&gt;RTA: Jamie Whitt Room: Taylor 210B Ext: 6469')\">Efird Residence Hall</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href='#' onclick=\"sideMap('36.134312', '-80.279450', '&lt;br&gt;&lt;b&gt;Taylor Residence Hall&lt;/b&gt;&lt;br&gt; RTA: Jamie Whitt Room: Taylor 210B Ext: 6469')\">Taylor Residence Hall</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href='#' onclick=\"sideMap('36.133464', ' -80.278886', '&lt;br&gt;&lt;b&gt;Davis Residence Hall&lt;/b&gt;&lt;br&gt;RTA: Patrick Kruse Room: 206B Ext: 6274')\">Davis Residence Hall</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href='#' onclick=\"sideMap('36.130925', '-80.277824', '&lt;br&gt;&lt;b&gt;Luter Residence Hall&lt;/b&gt;&lt;br&gt;RTA: Jay Patel Room: 216A Ext: 1449&lt;br&gt;RTA: Rich Stevens Room: 216A Ext: 1449')\">Luter Residence Hall</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href='#' onclick=\"sideMap('36.131405', '-80.277067', '&lt;br&gt;&lt;b&gt;Babcock Residence Hall&lt;/b&gt;&lt;br&gt;RTA: Krista Moore Room: 302A Ext: 1753&lt;br&gt;RTA: Ashleigh Parker Room: 302A Ext: 1753')\">Babcock Residence Hall</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href='#' onclick=\"sideMap('36.131733', '-80.276471', '&lt;br&gt;&lt;b&gt;Johnson Residence Hall&lt;/b&gt;&lt;br&gt;RTA: Nick Tetsworth Room: 315B Ext: 1232')\">Johnson Residence Hall</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href='#' onclick=\"sideMap('36.132212', '-80.275698', '&lt;br&gt;&lt;b&gt;Bostwick Residence Hall&lt;/b&gt;&lt;br&gt;RTA: Saket Munshaw Room: 304A Ext: 7114&lt;br&gt;RTA: Collin Wonnacott Room: 304A Ext: 7114')\">Bostwick Residence Hall</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href='#' onclick=\"sideMap('36.131531', '-80.275600', '&lt;br&gt;&lt;b&gt;Collins Residence Hall&lt;/b&gt;&lt;br&gt;RTA: Catherine Williams Room: 208B Ext: 1623')\">Collins Residence Hall</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href='#' onclick=\"sideMap('36.134445', '-80.277690', '&lt;br&gt;&lt;b&gt;Kitchin Residence Hall&lt;/b&gt;&lt;br&gt;RTA: Lindsay Ryerse Room: 304B Ext: 6919')\">Kitchin Residence Hall</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href='#' onclick=\"sideMap('36.135290', '-80.277738', '&lt;br&gt;&lt;b&gt;Poteat Residence Hall&lt;/b&gt;&lt;br&gt;RTA: Ross Williford Room: Poteat 101D Ext: 6679')\">Poteat Residence Hall</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href='#' onclick=\"sideMap('36.135230', '-80.278569', '&lt;br&gt;&lt;b&gt;Huffman Residence Hall&lt;/b&gt;&lt;br&gt;RTA: Ross Williford Room: Poteat 101D Ext: 6679')\">Huffman Residence Hall</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href='#' onclick=\"sideMap('36.135920', '-80.272618', '&lt;br&gt;&lt;b&gt;Piccolo Residence Hall&lt;/b&gt;&lt;br&gt;RTA: Eric Fluck Room: Palmer 018 Ext: 7015')\">Piccolo Residence Hall</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href='#' onclick=\"sideMap('36.135481', '-80.272902', '&lt;br&gt;&lt;b&gt;Palmer Residence Hall&lt;/b&gt;&lt;br&gt;RTA: Eric Fluck Room: Palmer 018 Ext: 7015')\">Palmer Residence Hall</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href='#' onclick=\"sideMap('36.138524', '-80.281886', '&lt;br&gt;&lt;b&gt;Martin Residence Hall&lt;/b&gt;&lt;br&gt;RTA: Rachael Mongold Room: Polo 411C Ext: 8218')\">Martin Residence Hall</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href='#' onclick=\"sideMap('36.137657', '-80.281392', '&lt;br&gt;&lt;b&gt;Polo Residence Hall&lt;/b&gt;&lt;br&gt;RTA: Rachael Mongold Room: Polo 411C Ext: 8218')\">Polo Residence Hall</a>";
	}
	
	function localSide()  //loads local links into side bar
	{
		if (swAllMarked == 1)
		{
			map.clearOverlays();
			swAllMarked = 0;
		}
		parkSW = 0;
		map.clearOverlays();
		
		document.getElementById("side_bar").innerHTML = "<p align='left' class='style3'><span class='style9'>Local Information </span></p>";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<span class=\"style3\"><a href=\"#\" onclick=\"sideMap('36.06964444444', '-80.3004944', '&lt;br&gt;Hanes Mall')\">Hanes Mall</a></span> <span class=\"style7\"><a href=\"http://www.google.com/maps?source=uds&amp;daddr=36.069976,-80.299362&amp;saddr=36.13359,-80.278805&amp;iwstate1=dir%3Ato\" target=\"_blank\">(Map To)</a></span><br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<span class=\"style3\"><a href=\"#\" onclick=\"sideMap('36.090275', '-80.26706388', '&lt;br&gt;Wake Forest University School of Medicine')\">Wake Forest University School of Medicine</a></span> <span class=\"style7\"><a href=\"http://www.google.com/maps?source=uds&amp;daddr=36.090275,-80.26706388&amp;saddr=36.13359,-80.278805&amp;iwstate1=dir%3Ato\" target=\"_blank\">(Map To)<br /></a></span> ";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<span class=\"style3\"><a href=\"#\" onclick=\"sideMap('36.192177', '-80.273945', '&lt;br&gt;Walmart')\">Walmart</a></span> <span class=\"style7\"><a href=\"http://www.google.com/maps?source=uds&amp;daddr=36.189620,-80.273726&amp;saddr=36.13359,-80.278805&amp;iwstate1=dir%3Ato\" target=\"_blank\">(Map To)</a></span><br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<span class=\"style3\"><a href=\"#\" onclick=\"sideMap('36.182611', '-80.273254', '&lt;br&gt;Lowes Hardware')\">Lowes Hardware</a></span> <span class=\"style7\"><a href=\"http://www.google.com/maps?source=uds&amp;daddr=University Pkwy @36.182917,-80.274752 to:Summit Point Ln @36.182611, -80.273254&amp;saddr=36.13359,-80.278805&amp;iwstate1=dir%3Ato\" target=\"_blank\">(Map To)</a></span><br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<span class=\"style3\"><a href=\"#\" onclick=\"sideMap('36.168102', '-80.279', '&lt;br&gt;Target')\">Target</a></span> <span class=\"style7\"><a href=\"http://www.google.com/maps?source=uds&amp;daddr=N Cherry St @36.169090, -80.277190&amp;saddr=36.13359,-80.278805&amp;iwstate1=dir%3Ato\" target=\"_blank\">(Map To)</a></span><br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<span class=\"style3\"><a href=\"#\" onclick=\"sideMap('36.064279', '-80.308471', '&lt;br&gt;BestBuy')\">BestBuy</a></span> <span class=\"style7\"><a href=\"http://www.google.com/maps?source=uds&amp;daddr=36.064279, -80.308471&amp;saddr=36.13359,-80.278805&amp;iwstate1=dir%3Ato\" target=\"_blank\">(Map To)</a></span><br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<span class=\"style3\"><a href=\"#\" onclick=\"sideMap('36.152478', '-80.280055', '&lt;br&gt;Office Depot')\">Office Depot</a></span> <span class=\"style7\"><a href=\"http://www.google.com/maps?source=uds&amp;daddr=University Pkwy @36.150920, -80.279060 to:N Point Blvd @36.151234, -80.281124&amp;saddr=36.13359,-80.278805&amp;iwstate1=dir%3Ato\" target=\"_blank\">(Map To)</a></span><br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<span class=\"style3\"><a href=\"#\" onclick=\"sideMap('36.127823', '-80.258000', '&lt;br&gt;Lawrence Joel Vets Coliseum')\">Lawrence Joel Vets Coliseum</a></span> <span class=\"style7\"><a href=\"http://www.google.com/maps?source=uds&amp;daddr=36.127823, -80.258000&amp;saddr=36.13359,-80.278805&amp;iwstate1=dir%3Ato\" target=\"_blank\">(Map To)</a></span><br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<span class=\"style3\"><a href=\"#\" onclick=\"sideMap('36.130600', '-80.254726', '&lt;br&gt;Groves Stadium')\">Groves Stadium</a></span> <span class=\"style7\"><a href=\"http://www.google.com/maps?source=uds&amp;daddr=36.130600, -80.254726&amp;saddr=36.13359,-80.278805&amp;iwstate1=dir%3Ato\" target=\"_blank\">(Map To)</a></span><br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<span class=\"style3\"><a href=\"#\" onclick=\"sideMap('36.129874', '-80.252204', '&lt;br&gt;Ernie Shore Ball Park')\">Ernie Shore Ball Park</a></span> <span class=\"style7\"><a href=\"http://www.google.com/maps?source=uds&amp;daddr=36.129874, -80.252204&amp;saddr=36.13359,-80.278805&amp;iwstate1=dir%3Ato\" target=\"_blank\">(Map To)</a></span><br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<span class=\"style3\"><a href=\"#\" onclick=\"sideMap('36.341066', '-80.476428', '&lt;br&gt;Pilot Mountain State Park')\">Pilot Mountain State Park</a></span> <span class=\"style7\"><a href=\"http://www.google.com/maps?source=uds&amp;daddr=36.341066, -80.476428&amp;saddr=36.13359,-80.278805&amp;iwstate1=dir%3Ato\" target=\"_blank\">(Map To)</a></span><br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<span class=\"style3\"><a href=\"#\" onclick=\"sideMap('36.394898', '-80.266392', '&lt;br&gt;Hanging Rock State Park')\">Hanging Rock State Park</a></span> <span class=\"style7\"><a href=\"http://www.google.com/maps?source=uds&amp;daddr=36.394898, -80.266392&amp;saddr=36.13359,-80.278805&amp;iwstate1=dir%3Ato\" target=\"_blank\">(Map To)</a></span><br />";
		
	}
	
	function gateSide()  //loads campus gate locations into side bar
	{
		if (swAllMarked == 1)
		{
			map.clearOverlays();
			swAllMarked = 0;
		}
		
		parkSW = 0;
		map.clearOverlays();
		
		document.getElementById("side_bar").innerHTML = "<p align=\"left\" class=\"style3\"><span class=\"style9\">Campus Gates</span></p>";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href=\"#\" onclick=\"sideMap('36.130006', '-80.286774', '&lt;br&gt;Reynolda Road Gatehouse')\">Reynolda Road Gatehouse</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href=\"#\" onclick=\"sideMap('36.137200', '-80.272954', '&lt;br&gt;University Parkway Gatehouse')\">University Parkway Gatehouse</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href=\"#\" onclick=\"sideMap('36.138601', '-80.278143', '&lt;br&gt;Polo Road Gate')\">Polo Road Gate</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<br /><a href=\"#\" onclick=\"sideMap('36.134423', '-80.278344', '&lt;br&gt;Hearn Plaza')\">Hearn Plaza</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href=\"#\" onclick=\"sideMap('36.132763', '-80.276748', '&lt;br&gt;Manchester Plaza')\">Manchester Plaza</a> <br />";
	
	}
	
	function apptSide()  //loads campus appartment links into side bar
	{
		
		if (swAllMarked == 1)
		{
			map.clearOverlays();
			swAllMarked = 0;
		}
		parkSW = 0;
		map.clearOverlays();
		
		document.getElementById("side_bar").innerHTML = "<p align=\"left\" class=\"style3\"><span class=\"style9\">APARTMENTS</span></p>";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href=\"#\" onclick=\"sideMap('36.138969', '-80.275741', '&lt;br&gt;Residential Community')\">Residential Community</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href=\"#\" onclick=\"sideMap('36.137951', '-80.276902', '&lt;br&gt;Townhouse Apartments')\">Townhouse Apartments</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href=\"#\" onclick=\"sideMap('36.134251', '-80.282414', '&lt;br&gt;Faculty/Staff Apartments')\">Faculty/Staff Apartments</a> <br />";
		document.getElementById("side_bar").innerHTML = document.getElementById("side_bar").innerHTML + "<a href=\"#\" onclick=\"sideMap('36.137656', '-80.282450', '&lt;br&gt;&lt;b&gt;Student Apartments&lt;/b&gt;&lt;br&gt;RTA: Rachael Mongold Room: Polo 411C Ext: 8218')\">Student Apartments</a>";
	}
	
	
	function visitor()    //maps visitor parking spaces links into side bar
	{
		
		if (swAllMarked == 1)
		{
			map.clearOverlays();
			swAllMarked = 0;
		}
		parkSwitch(36.133570, -80.277638);
		parkSide();
		
//		KEEPING THIS SECTION FOR POLYLINES EXAMPLE
//		var Polypoints = [ new GLatLng(36.133406,  -80.278238), new GLatLng(36.133139, -80.277950), new GLatLng(36.132817, -80.278499), new GLatLng(36.133119, -80.278772), new GLatLng(36.133406,  -80.278238)];
//		map.addOverlay(new GPolygon(Polypoints, "#ffff00", 5, 0.6, "#ffff00", 0.6));
//		Polypoints = [ new GLatLng(36.133819, -80.279504), new GLatLng(36.133632, -80.279332), new GLatLng(36.133960, -80.278790), new GLatLng(36.134164, -80.279000), new GLatLng(36.133819, -80.279504)];
//		map.addOverlay(new GPolygon(Polypoints, "#ffff00", 5, 0.6, "#ffff00", 0.6));
//		var Polypoints = [ new GLatLng(36.131305, -80.283613), new GLatLng(36.130963, -80.283456), new GLatLng(36.130885, -80.283784), new GLatLng(36.131255, -80.283899), new GLatLng(36.131305, -80.283613)];
//		map.addOverlay(new GPolygon(Polypoints, "#ffff00", 5, 0.6, "#ffff00", 0.6));
//		var Polypoints = [ new GLatLng(), new GLatLng(), new GLatLng(), new GLatLng(), new GLatLng()];
		
		var vpoint = new GLatLng(36.133066, -80.278384);
		var vmarker = createPark(vpoint,'Visitor','<br><b>Visitor Parking</b>','http://www.wfu.edu/~murphytj/images/markerVisitor.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.133898, -80.279117);
		var vmarker = createPark(vpoint,'Visitor','<br><b>Visitor Parking</b>','http://www.wfu.edu/~murphytj/images/markerVisitor.png')
	    map.addOverlay(vmarker);
		
		vpoint = new GLatLng(36.131138, -80.283677);
		var vmarker = createPark(vpoint,'Visitor','<br><b>Visitor Parking</b>','http://www.wfu.edu/~murphytj/images/markerVisitor.png')
	    map.addOverlay(vmarker);
		
	}
	
		
//	function readML(deptIN, buildIN)  //read department list xml and load into side bar
//	{
//		 side_bar_html = "";
//	 	
//	 
//		document.getElementById("side_bar").innerHTML = "";
//	
//	 
//		 //extract file prefix for use in table header
//		 var deptHead = deptIN.substring(0, deptIN.search(/\./));
//		 deptHead = deptHead.substring(0, 1).toUpperCase() + deptHead.substring(1);
//	 
//		 if (deptHead != "Blank")
//		 {
//			 
//			 deptIN = "data/" + deptIN; //add folder name to deptIN
//			 
//			 // Read the data from example.xml
//			 var request = GXmlHttp.create();			
//			 request.open("GET", deptIN, true);
//			 request.onreadystatechange = function() 
//			 	{
//					
//					if (request.readyState == 4) 
//					{
//						var xmlDoc = GXml.parse(request.responseText);
//								
//						// obtain the array of markers and loop through it
//						var personList = xmlDoc.documentElement.getElementsByTagName("person");
//						var deptHold = ""; //switch to cycle department header
//						var firstRun = 0;  //switch to cycle on the table tag
//						
//						for (var i = 0; i < personList.length; i++) 
//						{
//							// obtain the attribues of each marker
//							var dept = personList[i].getAttribute("dept");
//							var name = personList[i].getAttribute("name");
//							var phone = personList[i].getAttribute("phone");;
//							var office = personList[i].getAttribute("office");
//							var email = personList[i].getAttribute("email");
//							
//							
//							if (dept != deptHold)
//							{
//								if (firstRun == 1)
//								{
//									side_bar_html = side_bar_html + "</table>";	
//									
//								}
//								side_bar_html = side_bar_html + "<table>";
//								
//								//load side bar with back funtion
//								side_bar_html = side_bar_html + "<b><a href=\"#\" onclick=\"readMLX(\'" + buildIN + "\')\"> <-Go Back</a></b>";
//								
//								side_bar_html = side_bar_html + "<tr><td colspan=3 align=\'center\' bgcolor=\'#CCCCCC\'><b>" + dept + "</b> </td></tr>";								
//								side_bar_html = side_bar_html + "<tr><td><b>Name</b></td><td><b>Phone</b></td><td><b>Room</b></td></tr>";
//								deptHold = dept;
//							}
//							side_bar_html = side_bar_html + "<tr><td>";
//							
//							if (email.indexOf("@") == -1)
//							{
//								email = email + "@wfu.edu";
//							} 
//							side_bar_html = side_bar_html + "<a href=\'mailto:" + email + "\'>" + name + "</a> </td><td bgcolor=\"#FFCC00\"><b> " + phone + "  </b></td><td align=\'left\' bgcolor=\"#000000\"><font color=\"#FFFFFF\"><b>  " + office + "</b></font></td></tr>";
//							firstRun = 1;
//						}
//														
//						// put the assembled side_bar_html contents into the side_bar div
//						document.getElementById("side_bar").innerHTML = side_bar_html;
//					}
//				}
//			    request.send(null);
//		 }
//			
//	}
	
	function readALL(deptField, bldgField, loadST)
	{
		
		//alert(deptField + ":" + bldgField + ":" + loadST);
		side_bar_html = "";
		document.getElementById("side_bar").innerHTML = "";
		var request = GXmlHttp.create();			
		request.open("GET", "data/all1.xml", true);
		
		switch(loadST)
		{
			case "a": //all selected
//*********************************************************************************
				side_bar_html = "<b>BUILDING DIRECTORIES</b><br><br>";
				request.onreadystatechange = function() 
			 	{
					
					if (request.readyState == 4) 
					{
						var xmlDoc = GXml.parse(request.responseText);
								
						// obtain the array of markers and loop through it
						var personList = xmlDoc.documentElement.getElementsByTagName("person");
						var deptHold = ""; //switch to cycle department header
						var deptPrint = "";
						var firstRun = 0;  //switch to cycle on the spacer row
								
						for (var i = 0; i < personList.length; i++) 
						{
							// obtain the attribues of each marker
							var bldg = personList[i].getAttribute("bldg");
							var dept = personList[i].getAttribute("dept");
							//dept = dept.replace("'", "");
							
							
							if (dept != deptHold)
							{		
								
								deptPrint = dept;
								deptPrint = deptPrint.replace(/ /gi, "");  //remove spaces for filename access
								deptPrint = deptPrint.replace("'", "");		//remove apostrophes too
								deptPrint = deptPrint.toLowerCase();		//drop to lower case
								
								deptHold = dept;
									
								//create
								side_bar_html = side_bar_html + "<a href=\"#\" onclick=\"readALL(\'" + dept + "\',\'" + bldg + "\',\'d\')\">" + dept + "</a><br>";
									
									
								//alert(side_bar_html);
							}
							firstRun = firstRun + 1;
							
						}	
						// put the assembled side_bar_html contents into the side_bar div
						document.getElementById("side_bar").innerHTML = side_bar_html;
					}					
				}

//*********************************************************************************				
				break;
			case "b": //building selected
//""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
				side_bar_html = "<b>BUILDING DIRECTORIES</b><br><br>";
				request.onreadystatechange = function() 
			 	{
					
					if (request.readyState == 4) 
					{
						var xmlDoc = GXml.parse(request.responseText);
								
						// obtain the array of markers and loop through it
						var personList = xmlDoc.documentElement.getElementsByTagName("person");
						var deptHold = ""; //switch to cycle department header
						var deptPrint = "";
						var firstRun = 0;  //switch to cycle on the spacer row
								
						for (var i = 0; i < personList.length; i++) 
						{
							// obtain the attribues of each marker
							var bldg = personList[i].getAttribute("bldg");
							var dept = personList[i].getAttribute("dept");
							
							if (bldg == bldgField)
							{
								
								if (dept != deptHold)
								{		
									
									deptPrint = dept;
									deptPrint = deptPrint.replace(/ /gi, "");  //remove spaces for filename access
									deptPrint = deptPrint.replace("'", "");		//remove apostrophes too
									deptPrint = deptPrint.toLowerCase();		//drop to lower case
									
									deptHold = dept;
									
									//create
									side_bar_html = side_bar_html + "<a href=\"#\" onclick=\"readALL(\'" + dept + "\',\'" + bldgField + "\',\'d\')\">" + dept + "</a><br>";
									
									
									//alert(side_bar_html);
								}
								firstRun = firstRun + 1;
							}
						}	
						// put the assembled side_bar_html contents into the side_bar div
						document.getElementById("side_bar").innerHTML = side_bar_html;
					}					
				}
				
				
//*************************************************************************
				break;
			case "d": //department selected
//*************************************************************************
				side_bar_html = side_bar_html + "<b><a href=\"#\" onclick=\"readALL('','','a')\">Master Department List</a></b><br>";
				//document.getElementById("nameList").innerHTML = "";
				//var select_html = "<select>";
				request.onreadystatechange = function() 
			 	{
					
					if (request.readyState == 4) 
					{
						var xmlDoc = GXml.parse(request.responseText);
								
						// obtain the array of markers and loop through it
						var personList = xmlDoc.documentElement.getElementsByTagName("person");
						var deptHold = ""; //switch to cycle department header
						var firstRun = 0;  //switch to cycle on the table tag
						
						
						
						for (var i = 0; i < personList.length; i++) 
						{
							
							// obtain the attribues of each marker
							var dept = personList[i].getAttribute("dept");
							var name = personList[i].getAttribute("name");
							var phone = personList[i].getAttribute("phone");;
							var office = personList[i].getAttribute("office");
							var email = personList[i].getAttribute("email");
							
							if (phone.substr(0,3) == '336')
							{
								phone = phone.substring(4);
							}
							
							if (dept == deptField)
							{
								//alert(deptField + " " + bldgField + " " + loadST);
								if (dept != deptHold)
								{
									
									side_bar_html = side_bar_html + "<table>";
									
									//load side bar with back funtion
									side_bar_html = side_bar_html + "<b><a href=\"#\" onclick=\"readALL(\'" + deptField + "\',\'" + bldgField + "\',\'b\')\"> <-Go Back</a></b>";
									
									side_bar_html = side_bar_html + "<tr><td colspan=3 align=\'center\' bgcolor=\'#CCCCCC\'><b>" + dept + "</b> </td></tr>";								
									side_bar_html = side_bar_html + "<tr><td width=\'40%\'><b>Name</b></td><td><b>Phone</b></td><td><b>Room</b></td></tr>";
									deptHold = dept;
//									select_html += "<option>----" + dept + "----</option>";
								}
								side_bar_html = side_bar_html + "<tr><td>";
								
								if (email.indexOf("@") == -1)
								{
									email = email + "@wfu.edu";
								} 
//								select_html += "<option>" + name + " " + phone + " " + email + "</option>";
								side_bar_html = side_bar_html + "<a href=\'mailto:" + email + "\'>" + name + "</a> </td><td bgcolor=\"#FFCC00\"><b> " + phone + "  </b></td><td align=\'left\' bgcolor=\"#000000\"><font color=\"#FFFFFF\"><b>  " + office + "</b></font></td></tr>";
								firstRun = 1;
							}
						}
						
						side_bar_html = side_bar_html + "</table><br>All phone numbers are area code 336 unless otherwise indicated.";
//						select_html += "</select>";
						//alert(select_html);
						
//						document.getElementById("nameList").innerHTML = select_html;
						// put the assembled side_bar_html contents into the side_bar div
						document.getElementById("side_bar").innerHTML = side_bar_html;
					}
				}
//*********************************************************
				break;
		}
		request.send(null);
		
	}
	
	
//	function readMLX(deptIN)  //read department list xml and load into side bar
//	{
//		 
//		 
//		 side_bar_html = "<b>BUILDING DIRECTORIES</b><br><br>";
//	 
//	 
//		document.getElementById("side_bar").innerHTML = "";
//	
//	 
//		 //extract file prefix for use in table header
//		 var deptHead = deptIN.substring(0, deptIN.search(/\./));
//		 deptHead = deptHead.substring(0, 1).toUpperCase() + deptHead.substring(1);
//	 
//		 if (deptHead != "Blank")
//		 {
//			 var build = deptIN; 
//			 deptIN = "data/" + deptIN; //add folder name to deptIN
//			 
//			 // Read the data from example.xml
//			 var request = GXmlHttp.create();			
//			 request.open("GET", deptIN, true);
//			 request.onreadystatechange = function() 
//			 	{
//					
//					if (request.readyState == 4) 
//					{
//						var xmlDoc = GXml.parse(request.responseText);
//								
//						// obtain the array of markers and loop through it
//						var personList = xmlDoc.documentElement.getElementsByTagName("person");
//						var deptHold = ""; //switch to cycle department header
//						var deptPrint = "";
//						var firstRun = 0;  //switch to cycle on the spacer row
//											
//						 //<tr><th>" + deptHead + " List</th><th>Phone</th><th>Room</th></tr>";
//						
//						//<a href="javascript:;" onmousedown="toggleDiv('mydiv');">Toggle Div Visibility</a>
//						//<div id="mydiv" style="display:none"><h3>This is a test!<br>Can you see me?</h3></div>
//						
//						//"<a href=\"javascript:;\" onmousedown=\"toggleDiv('mydiv');\">Show/Hide</a>"
//								
//						for (var i = 0; i < personList.length; i++) 
//						{
//							// obtain the attribues of each marker
//							var dept = personList[i].getAttribute("dept");							
//							
//							if (dept != deptHold)
//							{				
//								deptPrint = dept;
//								deptPrint = deptPrint.replace(/ /gi, "");  //remove spaces for filename access
//								deptPrint = deptPrint.replace("'", "");		//remove apostrophes too
//								deptPrint = deptPrint.toLowerCase();		//drop to lower case
//								
//								//create
//								side_bar_html = side_bar_html + "<a href=\"#\" onclick=\"readML(\'" + deptPrint + ".xml\',\'" + build +"\')\">" + dept + "</a><br>";
//								deptHold = dept;
//								//alert(side_bar_html);
//							}
//							firstRun = firstRun + 1;
//						}
//						
//												
//						// put the assembled side_bar_html contents into the side_bar div
//						document.getElementById("side_bar").innerHTML = side_bar_html;
//					}
//				}
//				
//			    request.send(null);
//		 }
//			
//	}
		
	// A function to create the marker and set up the event window
    function createPark(point,name,html,img) 
	{
		
		// Create a base icon for all of our markers that specifies the
	    // shadow, icon dimensions, etc.
	    var parkIcon = new GIcon();
	    
		//baseIcon.shadow = "http://www.wfu.edu/~murphytj/images/markerWFUs.png";
	    //parkIcon.iconSize = new GSize(22, 57);
	    //baseIcon.shadowSize = new GSize(65, 68);
	    parkIcon.iconAnchor = new GPoint(15, 11);
	    parkIcon.infoWindowAnchor = new GPoint(9, 2);
    	parkIcon.infoShadowAnchor = new GPoint(18, 75);
	
	
		// Create a lettered icon for this point using our icon class
		//var letter = String.fromCharCode("A".charCodeAt(0) + index);
		var park = new GIcon(parkIcon);		
		park.image = img;
		
        // Set up our GMarkerOptions object
        markerOptions = { icon:park };
		  
        var marker = new GMarker(point, markerOptions);

        // The info window version with the "to here" form open
        to_htmls[i] = html + '<br>Directions: <b>To here</b> - <a href="javascript:fromhere(' + i + ')">From here</a>' +
           '<br>Start address:<form action="http://maps.google.com/maps" method="get" target="_blank">' +
           '<input type="text" SIZE=40 MAXLENGTH=40 name="saddr" id="saddr" value="" /><br>' +
           '<INPUT value="Get Directions" TYPE="SUBMIT">' +
           '<input type="hidden" name="daddr" value="' + point.lat() + ',' + point.lng() + 
                  // "(" + name + ")" + 
           '"/>';
        
		// The info window version with the "to here" form open
        from_htmls[i] = html + '<br>Directions: <a href="javascript:tohere(' + i + ')">To here</a> - <b>From here</b>' +
           '<br>End address:<form action="http://maps.google.com/maps" method="get"" target="_blank">' +
           '<input type="text" SIZE=40 MAXLENGTH=40 name="daddr" id="daddr" value="" /><br>' +
           '<INPUT value="Get Directions" TYPE="SUBMIT">' +
           '<input type="hidden" name="saddr" value="' + point.lat() + ',' + point.lng() +
                  // "(" + name + ")" + 
           '"/>';
        
		// The inactive version of the direction info
        html += '<br>Directions: <a href="javascript:tohere('+i+')">To here</a> - <a href="javascript:fromhere('+i+')">From here</a>';

        GEvent.addListener(marker, "click", function() {
	          marker.openInfoWindowHtml(html);
	        });
        gmarkers[i] = marker;
        htmls[i] = html;

		index++;
		i = 0;

		return marker;

	}
	
	
	// A function to create the WF Spinner marker and set up the event window
    function WFicon(point,img) 
	{
		
		//point = new GLatLng(36.134366, -80.278404);
		name = "Spin";
		html = "<br><b>Welcome to Wake Forest University</b>";
		//img = "http://www.wfu.edu/chemistry/tools/wfuSpinner.gif";
		
		// Create a base icon for all of our markers that specifies the
	    // shadow, icon dimensions, etc.
	    var parkIcon = new GIcon();
	    
		//baseIcon.shadow = "http://www.wfu.edu/~murphytj/images/markerWFUs.png";
	    //parkIcon.iconSize = new GSize(92, 61);
	    //baseIcon.shadowSize = new GSize(65, 68);
		
		parkIcon.iconSize = new GSize(69, 45);
	    parkIcon.iconAnchor = new GPoint(15, 11);
	
	
		// Create a lettered icon for this point using our icon class
		//var letter = String.fromCharCode("A".charCodeAt(0) + index);
		var park = new GIcon(parkIcon);		
		park.image = img;
		
        // Set up our GMarkerOptions object
        markerOptions = { icon:park };
		  
        var marker = new GMarker(point, markerOptions);
        gmarkers[i] = marker;
        htmls[i] = html;
		return marker;

	}
	
	

    // A function to create the marker and set up the event window
    function createMarker(point,name,html) 
	{

		if (parkSW ==1)
		{
			map.clearOverlays();
			parkSW = 0;
		}		
		
		// Create a lettered icon for this point using our icon class
		var letter = String.fromCharCode("A".charCodeAt(0) + index);
		var letteredIcon = new GIcon(baseIcon);		
		letteredIcon.image = "http://www.wfu.edu/~murphytj/images/markerWFU.png"
		
        // Set up our GMarkerOptions object
        markerOptions = { icon:letteredIcon };
		  
        var marker = new GMarker(point, markerOptions);

        // The info window version with the "to here" form open
        to_htmls[i] = html + '<br>Directions: <b>To here</b> - <a href="javascript:fromhere(' + i + ')">From here</a>' +
           '<br>Start address:<form action="http://maps.google.com/maps" method="get" target="_blank">' +
           '<input type="text" SIZE=40 MAXLENGTH=40 name="saddr" id="saddr" value="" /><br>' +
           '<INPUT value="Get Directions" TYPE="SUBMIT">' +
           '<input type="hidden" name="daddr" value="' + point.lat() + ',' + point.lng() + 
                  // "(" + name + ")" + 
           '"/>';
        
		// The info window version with the "to here" form open
        from_htmls[i] = html + '<br>Directions: <a href="javascript:tohere(' + i + ')">To here</a> - <b>From here</b>' +
           '<br>End address:<form action="http://maps.google.com/maps" method="get"" target="_blank">' +
           '<input type="text" SIZE=40 MAXLENGTH=40 name="daddr" id="daddr" value="" /><br>' +
           '<INPUT value="Get Directions" TYPE="SUBMIT">' +
           '<input type="hidden" name="saddr" value="' + point.lat() + ',' + point.lng() +
                  // "(" + name + ")" + 
           '"/>';
        
		// The inactive version of the direction info
        html += '<br>Directions: <a href="javascript:tohere('+i+')">To here</a> - <a href="javascript:fromhere('+i+')">From here</a>';

        GEvent.addListener(marker, "click", function() {
	          marker.openInfoWindowHtml(html);
	        });
        gmarkers[i] = marker;
        htmls[i] = html;

//		index++;
		i = 0;

		return marker;

	}

    // functions that open the directions forms
    function tohere(i) 
	{
        gmarkers[i].openInfoWindowHtml(to_htmls[i]);
    }
    
	function fromhere(i) 
	{
        gmarkers[i].openInfoWindowHtml(from_htmls[i]);
    }
	  
	
	//function for adding campus marker locations
	function sideMap(Val1, Val2, msg, dept)
	{
		map.setCenter(new GLatLng(Val1, Val2), 17);
		var point = new GLatLng( Val1, Val2);			
	    var marker = createMarker(point,'Salem', msg);
	    map.addOverlay(marker);
	}
	
	
	//function for adding campus marker locations
	function changeMap(Val1, Val2, msg, dept, bldg, cond)
	{
		map.setCenter(new GLatLng(Val1, Val2), 17);
		var point = new GLatLng( Val1, Val2);			
	    var marker = createMarker(point,'Salem', msg);
	    map.addOverlay(marker);
	
		//triggers the click function for the marker
	  	GEvent.trigger(marker, "click");			
		
		if (bldg != "")
		{
			
			readALL(dept, bldg, cond);
		}
		else
		{
			document.getElementById("side_bar").innerHTML = "";			
		}
	}
		
	//function to remove all marker points
	function clearMap()
	{
		map.clearOverlays();
		swAllMarked = 0;
		document.getElementById("side_bar").innerHTML = "";
		
		var spin = WFicon(); 		//vpoint,'Spin','<br><b>Welcome to Wake Forest University</b>','http://www.wfu.edu/chemistry/tools/wfuSpinner.gif'
	    map.addOverlay(spin);
	}
		
	//function for local attractions, Clears marker points first.
	function changeLocal(Val1, Val2, msg)
	{
		map.clearOverlays();
		swAllMarked = 0;
		map.setCenter(new GLatLng(Val1, Val2), 14);
		var point = new GLatLng( Val1, Val2);
	    var marker = createMarker(point,'Salem', msg);
	    map.addOverlay(marker);
			
		//triggers the click function for the marker
	  	GEvent.trigger(marker, "click");
			
	}


    // Display the map, with some controls and set the initial location 
    var map = new GMap2(document.getElementById("map"));
  
	//adds zoom control to map
	map.addControl(new GLargeMapControl());
      
	//add map type control
	map.addControl(new GMapTypeControl());
	
	map.addControl(new GScaleControl(200));
      
	//load and center map
//	map.setCenter(new GLatLng(36.13118333, -80.27948333333), 17, G_HYBRID_MAP);
	map.setCenter(new GLatLng(36.1342, -80.2784), 17, G_HYBRID_MAP);
    
    // Set marker with info windows 
    // of course the Chemistry Department is the center of all activity
    var point = new GLatLng(36.13118333, -80.27948333333);
	
	map.enableScrollWheelZoom();
	map.enableDoubleClickZoom();

	
	var lastPoint;
	GEvent.addListener(map, "mousemove", function(point)
	{
	
		var latLngStrF = point.lat().toFixed(14) + ', ' + point.lng().toFixed(14) ;
		
		
		lastPoint = point;
	});
	

//	////'mouseover' listener shows controls
//	GEvent.addListener(map, "mouseover", function()
//	{
//		map.showControls();
//	});
//	
	////'mouseout' listener hides controls

//	GEvent.addListener(map, "mouseout", function()
//	{
//		map.hideControls(); 
//	});
	

	  
	//adds search control to map
	//map.addControl(new google.maps.LocalSearch(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,20)));

	setStart();
	GEvent.addListener(map, "click", function()
		{
			var latLngStrF = lastPoint.lat().toFixed(6) + ', ' + lastPoint.lng().toFixed(6) ;
			//alert(latLngStrF);
			//document.form1.location.value = "Clicked Location: " + latLngStrF;
		});
}
else 
{
    // display a warning if the browser was not compatible
	alert("Sorry, the Google Maps API is not compatible with this browser");
}

    	
	// VERY small amounts of 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

	//This code was heavily modified by Tommy Murphy, Instructional Technology Consultant, Wake Forest University


    //]]>


//-->