$(document).ready(function() {
	    lasttoplimit = -1;
	    function view_topbooks(toplimit) {
	        if (lasttoplimit == toplimit && toplimit < 0) toplimit = -toplimit;
	        ktr = 0;
	        $('.table-top5 tbody tr').each(function() {
	            ktr++;
	            if (ktr > toplimit && toplimit > 0) {
	                $(this).fadeOut(function() {
	                    $(this).hide();
	                });
	            } else {
	                $(this).fadeIn(function() {
	                    $(this).show();
	                });
	            }
	        });
	        if (0 > toplimit) {
	            new_html = $('.tfoot_content').html().replace('Voir', 'Cacher');
	            $('.tfoot_content').html(new_html);
	            $('#hidden_rank').attr('id', 'hidden_rank_up');
	        } else {
	            new_html = $('.tfoot_content').html().replace('Cacher', 'Voir');
	            $('.tfoot_content').html(new_html);
	            $('#hidden_rank_up').attr('id', 'hidden_rank');
	        }
	        lasttoplimit = toplimit;
	    }
	    view_topbooks(6);
	    $('.table-top5 .tfoot_content').css('cursor', 'pointer');
	    $('.table-top5 .tfoot_content').click(function() {
	    	view_topbooks(-6);
	    });
	  });  
	/*$(window).load(function(){
		$('#nav a').each(function() {
			link_anchor = $(this).html();
			link_anchor = link_anchor.replace('Wettanbieter ', '');
			$(this).html(link_anchor);
		});
	});*/
