$(document).ready(function() {
	$("form#filter span").click(function() {
		$(this).toggleClass("active");
		if($(this).hasClass("active")) {
			var rel = $(this).attr("rel");
			$(this).append("<input type='hidden' name='fil[]' value='"+rel+"'>");
		} else {
			$(this).find("input").remove();
		}
	});
	
	$("input#defaultFilter").click(function() {
		$("form#filter span").removeClass("active").find("input").remove();
	});
	
});
