jQuery.fn.fadeToggle = function(speed, easing, callback) { 
   return this.animate({opacity: 'toggle'}, speed, easing, callback); 
};

$(document).ready(function() {
	$('.tags #tags_list li').click(function(e) {
		e.preventDefault();
		location.href = $('a', this).attr('href');
	});

	$('.tags h4 a').click(function(e) {
		e.preventDefault();
		$('#tags_list').fadeToggle();
	})
	
	if ($('#tags_list .selected a').length) {
		$('.paging a[href]').each(function(index, el) {
			el.href = $('#tags_list .selected a').attr('href') + $(el).attr('href').replace('?', '&');
		});
	}
})