	jQuery(document).ready(function(){
		//find the location td then the location data td
		var locName = jQuery("td:contains('Location:')").next().children("span").text(); //.css("color","pink");
		var safeLocName;
		var useURL;
		var MapService = 1; // 1 for google 0 for bing
		if (MapService == 0) {
			//bing wants URL encoded data
			safeLocName = escape(locName);
			//then build a string that is the URL to bing maps with the destination prefilled
			//useURL = "http://www.bing.com/maps/?v=2&cp=37.189372184355534~-80.38049316407819&lvl=8&sty=r&rtp=adr.~adr." + safeLocName + "%20montgomery%20county%20va";
			useURL = "http://www.bing.com/maps/default.aspx?where1=" + safeLocName + "%20montgomery%20county%20va&v=2";
			//useURL = "http://www.bing.com/maps/explore/default.aspx?where1=" + safeLocName + "%20montgomery%20county%20va&v=2";

		}else if (MapService == 1) {
			safeLocName = locName.replace(/" "/, "+");
			useURL = "http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=" + safeLocName + "+Montgomery+County+Virginia&ll=37.204355,-80.36499&spn=0.195791,0.292168&z=12";

		}
 		//then buil the anchor tag and replace the contents of above said td
		jQuery("td:contains('Location:')").next().children("span").html("<a href='" + useURL + "' target='_blank'>" + locName + "</a>");

	

		//Hide the registration label and text if there is no reg enabled.
		jQuery("div.template td:contains('No registration required.')").parent().css("display","none");
		jQuery("div.template td:contains('No registration required.')").parent().prev("tr").css("display","none");

		jQuery("#ctl14_ED_T td:contains('No registration required.')").parent().css("display","none");
		jQuery("#ctl14_ED_T td:contains('No registration required.')").parent().prev("tr").css("display","none");


	});