//	$(window).load(function() {
	$(document).ready(function() {
	
		$('ul.quickTree').quickTree();

		$("area").tooltip({
			track: true,
			delay: 0,
			showURL: false,
			showBody: "::",
			fixPNG: true,
			left: 0
		});
		$("a").tooltip({
			track: true,
			delay: 0,
			showURL: false,
			showBody: "::",
			fixPNG: true,
			left: 0
		});		
		$("label").tooltip({
			track: true,
			delay: 0,
			showURL: false,
			showBody: "::",
			fixPNG: true,
			left: 0
		});	
		$("dt").tooltip({
			track: true,
			delay: 0,
			showURL: false,
			showBody: "::",
			fixPNG: true,
			left: 0
		});			
		
		/* handle the user selections */
		$(".checklist .checkbox-select").click(
			function(event) {
				event.preventDefault();
				$(this).parent().addClass("selected");
				$(this).parent().find(":checkbox").attr("checked","checked");
				$(this).parent().siblings().find(":checkbox").removeAttr("checked");
				$(this).parent().siblings().removeClass("selected");
				$(".checklist").parent().find("#mod_search_searchword").removeAttr("disabled");
				$(".checklist").parent().find("#mod_search_searchword").removeClass("disabled");			
				$(".checklist").parent().find("button").removeAttr("disabled");
				$(".checklist").parent().find("button").removeClass("buttondisabled");	
				
				if ($("#choice_a").attr("checked")){
					$("#simpleSearchForm").attr("action","index.php");
				}else{
					$("#simpleSearchForm").attr("action","<?php echo $this->baseurl ?>/fid/family_information_directory_results.php");
				}
			}
		);
		$('#simpleSearchForm').submit(function() {
			if ($("#choice_b").attr("checked")){
				$("#searchTerms").attr("value", $("#mod_search_searchword").attr("value"));	
				$("#simpleSearchForm").attr("method", "get");	
			}		
		});
		$("#display_category").click(function () {
		  $("#categorybuttonsdialog").toggle();
		});		
	});	
