$(document).ready(function() {
	$form = $('#searchCriteriaForm');
	// Hide a bunch of stuff...
	$form.find('div.submit:not(:last)').hide(); // All submit rows bar the last one
	$form.find('fieldset:gt(0)').hide(); // All fieldsets bar the first one
	
	// Add "show / hide" link to last submit row.
	$('<p class="help"><a href="#" title="Toggle display of advanced search options">Show / hide advanced search options</a></p>')
	.appendTo($form.find('div.submit:last'))
	.click(function() {
		if($form.find('fieldset:gt(0):visible').length == 1) {
			$form.find('fieldset:gt(0)').hide();
		}
		else {
			$form.find('fieldset:gt(0)').show();
		}
		return(false);
	});
});
