/*
 * search.js
 * http://leonard.com
 */

/* Search box behavior */

$(document).ready(function() {

	/* Sets initial state if there is content in the search box. */
	if (jQuery.trim($('#searchQuery')[0].value).length != 0) {
		$('#searchLabel').addClass('hidden');
	}

	/* Hide the label when the input gets focus */


	$('#searchQuery').focus(function() {
		$('#searchLabel').addClass('hidden');
	});

	/* Show the label when the input loses focus if it's empty */
	$('#searchQuery').blur(function() {
		if ($.trim(this.value).length == 0) {
			$('#searchLabel').removeClass('hidden');
		}
	});

});
