(function($) {
	$.fn.emailReplace = function(){
		return this.each(function(){
			var email = $(this).text().replace(" (at) ", "@");
			$(this).attr("href", "mailto:" + email).html(email);
		});
	};
})(jQuery);


(function($) {
	$.fn.highlightNav = function(){
		return this.each(function(){
			var url = document.location.href;
			if (url.charAt(url.length-1) == "/") {
				url += "index.html";
			}
			$(this).find("a").each(function(){
				if (url.indexOf($(this).attr("href")) > -1) {
					$(this).addClass("selected");
				}
			});
		});
	};
})(jQuery);



$(document).ready(function(){
	$("#nav").highlightNav();
	$("a.email").emailReplace();
	
});


