$(function() {
	$(".pagination a, .tagcloud a").live("click", function () {
		var href = $(this).attr("href");
		getPosts(href);
		return false;
	});
	addBottom();
});

function getPosts (href) {
	var content = $("#content");
	content.html('<progress>please wait...</progress>');
	$.get(href, {x:1} , function(posts) {
		content.fadeOut(1,function () {
			content
			.html(posts)
			.slideDown("fast");
			addBottom();
		});
	});
};
function addBottom () {
	$('.box code').
		not(':has(.bottom)').
		append('<span class="bottom"></span>');
	$('section, div.box').
		not(':has(.bottom)').
		append('<div class="bottom"></div>');
	$('ul.box, ol.box').
		not(':has(.bottom)').
		append('<li class="bottom"></li>');
}
