$(document).ready(function(){

	// pagination for articles 
	
	var sets				= 0;
	var blocks_per_page		= 10;
	var selectors			= '#article-body p, #article-body ul, #article-body div';
	var n_sets				= Math.ceil($(selectors).length / blocks_per_page);

	$('div.pages li').hide();
	
	$(selectors).each(function(i){

		set = Math.floor(i / blocks_per_page);
		$(this).addClass('b' + set);

		if (set > 0){ $(this).hide(); }
	});

	for (i = 0; i < n_sets ; i++){ $('div.pages li:eq(' + i + ')').show(); }

	$('div.pages a').click(function(){

		$(selectors).hide();
		$('div.pages li').removeClass('active');
		rel = $(this).attr('rel');
		$('#article-body p.b' + rel + ', #article-body ul.b' + rel + ', #article-body div.b' + rel).show();
		$(this).parent().addClass('active');
		window.location = '#';
		return false;
	});
});