Hello there,

I'm using these code to expand/collapse my forum:

HTML Code:
jQuery.noConflict();
function toggleForums(catId) {
	var lctgCategory = "#cat_" + catId;
	
	jQuery(lctgCategory).next().toggle();
	jQuery(lctgCategory).toggleClass('collapsed');
}
Now I want to use jQuery Cookie for these expandables. I tried these codes:

HTML Code:
if (jQuery(lctgCategory).hasClass('collapsed')) {
		jQuery.cookie("catStatus","cat_"+catId+"_collapsed",{expires: 365});
	} else {
		jQuery.cookie("catStatus","cat_"+catId+"_expanded",{expires: 365});
	}
	
	if (jQuery.cookie("catStatus") == ("cat_"+catId+"_collapsed")) {
		jQuery(lctgCategory).next().toggle();
		jQuery(lctgCategory).toggleClass('collapsed');
	} else {
		jQuery(lctgCategory).next().toggle();
		jQuery(lctgCategory).toggleClass('collapsed');
	}
But nothing changes. Please help me know where is the wrong in these code. Thanks a lots!