$(document).ready(function(){

	// if the user's browser doesn't support placeholder functionality
	if (!('placeholder' in document.createElement("input"))) {
		// mimic it with script
		$("#search").focus(function(){
			if ($(this).hasClass("empty")) {
				$(this).val("");
				$(this).removeClass("empty");
			}
		}).blur(function(){
			if ($(this).val() == "") {
				$(this).addClass("empty");
				$(this).val($(this).attr("placeholder"));
			}
		}).blur();
	}

	// prevent user from searching for nothing
	$("#searchform form").bind("submit", function(){
		if ($("#search").hasClass("empty") || $("#search").val() == "") {
			return false;
		}
	});

});
