	
function tidySearch(theInput$) {
	if (theInput$.val() == "") theInput$.val("search");
	
	theInput$.focus(function() {
		if (theInput$.val() =="search") {
			theInput$.val("");
		}
	})
	.blur(function() {
		if (theInput$.val() == "") theInput$.val("search");
	});
}




$(document).ready(function() {
	tidySearch($("#searchform input"));
	
	// get rid of parens around cat counts
	var cats = $("#cats");
	cats.html( cats.html().replace( /\)/g, '') );
	cats.html( cats.html().replace( /\(/g, '') );
	


	
	// set up the image gallery
	$("#gal-wrapper a:parent").lightBox();
	
	// get rid of obfuscation
	$("a[href*='mailto']").click(function() {
		this.href = this.href.replace("_", "");
		this.href = this.href.replace(/\?.+/, "");
	});
	
	// on the home page, the nav scrolls you to each section.
	$("body.page-template-homepage-php #menu a").each(function() {
		$(this).click(function() {
			if (/#/.test(this.href)) {
				$.scrollTo(this.href.replace(/^.+#/, "#"), 800);
				return false;
			}
		});
	});
	
	// hovering over the categories links gives you the category list
	
	// $("#show-cats").click(
		// function() {
			// $(this).parent().toggleClass("active");
			// return false;
		// }
	// );
	// $("body").click(
		// function() {
			// $("#cats").removeClass("active");
		// }
	// );
			


	});	
	

	
	
	
	
	
	
	
	