
$(	function()
	{ 
		/*	Hide any subnav items in #sidebar */
		$('#sidebar ul ul').hide();
	
	
		/*	Highlight the current page in the sidebar */
		if (location.pathname.substring(1))
		{
			var current_link = $('#sidebar a[@href$="' + location.pathname.substring(1) + '"]');
			
			current_link.wrap('<strong></strong>');
			
			//	Highlight its parent list item (for subnav items)
			current_link.parents('li').parents('li').children('a').wrap('<strong></strong>');
			
			//	Show any subnavs
			current_link.parent('li').children('ul').show();
			
			current_link.parents('li').children('ul').show();
		}
		
		/*	Search box */
		var empty_str = $('#search_query').val();

		$('#search_query').focus(
			function()
			{				
				if (this.value == empty_str)
				{
					this.value = '';
				}
			}
		);
		
		$('#search_query').blur(
			function()
			{
				/*	Matches a string of white-space chars only */
				if ( /^(\s)*$/.test(this.value) )
				{
					this.value = empty_str;
				}
			}
		);
	}
);