$(document).ready(function(){
	$("#red").treeview({
		animated: "fast",
		collapsed: true,
		
	});

	var expandCate = function (cateEl)
	{
		

		if(cateEl != null || cateEl != 'undefined')
		{
			cateEl.next().css({display:'block'});
			cateEl.prev().attr('class', 'hitarea collapsable-hitarea');
			cateEl.parent().attr('class', 'collapsable');
			
			if(cateEl.parent().parent().attr('class') != 'treeview')
			{
				expandCate(cateEl.parent().parent().prev());
			}
		}
	}
	
	if(currentCateID != 'undefined')
	{
		expandCate($(".cat"+currentCateID));
	}
});

