//prep the doc
$(document).ready(function(){

var cat;

//on a resources category selection
$("ul#resourceCats li").click(function(){
	
	
	//if this setting is already on
	if ($(this).hasClass("on")) {
		return;
	}
	//otherwise turn it on
	else {
		//if this is the all categories option
		if ($(this).hasClass("all")) {
			//deactivate all the other ones and turn this one on
			$("ul#resourceCats li").removeClass("on");
			$(this).addClass("on");
			//show all the resources
			$("ul#resources li").show();
		}
		//if this is just a regular option
		else {
			//set the var to this cat
			cat = $(this).attr("id");
			//deactivate all the other ones and turn this one on
			$("ul#resourceCats li").removeClass("on");
			$(this).addClass("on");
			//hide all resources
			$("ul#resources li").hide();
			//show it's resources
			$("ul#resources li."+cat+", ul#resources li."+cat+" li").show();
		}
	}
	

});


});
