
function category_init() {
	$("ul.expander").hide();
	$("ul.expander2").hide();

	$("a.opencat").click(function(){
		s = $(this).attr('id').replace('l1cat','l1fold');
		if ($('#'+s).css('display') == 'none') {
			$("ul.expander").slideUp("slow");
			$('#'+s).slideToggle("slow", function () {
				if ($(this).css('display') != 'none') {
					$.cookie('folder', $(this).attr('id'))
				}
			});
		}
	})

	$("a.opencat2").click(function(){
		s = $(this).attr('id').replace('cat','fold');
		if ($('#'+s).css('display') == 'none') {
			$("ul.expander2").slideUp("slow");
			$('#'+s).slideToggle("slow", function() {
				if ($(this).css('display') != 'none') {
					$.cookie('folder2', $(this).attr('id'))
				}
			});
		}
	})
		

	if ($.cookie('folder')) {
		$('#' + $.cookie('folder')).show()
	}
	if ($.cookie('folder2')) {
		$('#' + $.cookie('folder2')).show()
	}

}

function twitter_init() {
	$("#twitter-feeds").hide();
	$("#twitter-links").click(function(){
		$("#twitter-feeds").slideToggle("slow");
		return false;
	});
}

$(document).ready(function(){
	category_init();
	twitter_init();
})

