$(document).ready(function(){
	
	$('#klassement .kalender').each(function(i, table){
		counter = 0;
		$('tr', table).each(function(i, row){
			if(counter > 5 && !$(row).hasClass("exp")){
				$( row ).css('display', 'none');
			}
			counter++;
		});
		$('tr.exp td', table).html('Toon het gehele klassement').attr('className', 'exp').bind('click', doExp );
	});
	

});


function doExp(ev){
	
	if($(this).attr('class') == "exp"){
		
		$('tr', this.parentNode.parentNode ).each(function(i, row){
			$(row).css('display', '');
		});
		$(this).attr('class', '').html('Toon enkel de top 5');
			
	} else {
		
		counter = 0;
		$('tr', this.parentNode.parentNode ).each(function(i, row){
			if(counter > 5 && !$(row).hasClass("exp")){
				$( row ).css('display', 'none');
			}
			counter++;
		});
		$(this).attr('class', 'exp').html('Toon het gehele klassement');		
	}
}

