

$(document).ready(function(){
	
	/* Hide these onload */
	$("#map_overlay").hide();
	
	$(".toggle").click(function () {
		$(this).parent().toggle();
	});
							 
	/* A nice long convoluted way to add a current class to an anchor based on the page title */
	var pageTitle = $(document).attr("title").toLowerCase();
	var pTitle = pageTitle.match(/\w+/g);
	//alert(pTitle[0]);
	$(pTitle).each(function (i) {
		//alert(pTitle[i]);
	});
	
	$("a").each(function (i) {
		 var anchorTitle = $(this).attr("title").toLowerCase();
		 var aTitle = anchorTitle.match(/\w+/g);
		 
		 $(pTitle).each(function (i) {
		 	if(pTitle[i]==aTitle[0]){			
			
			$("a").each(function (i) {
								 var aTitle2 = $(this).attr("title").toLowerCase();
								 
		 						 if (aTitle2==aTitle[0]) {
								 	$(this).addClass('current');
								 }
			});
			
		 }
		 });
		});
  
});
