var hiddenTexts = {show : 'Pokaż więcej', hide : 'Ukryj'};

$(document).ready(function(){
	$('.hidden-text').each(function() {
		$(this).show();
		var text = $(this).html();
		
		$(this).html('<a class="show-hidden-text" href="" >'+hiddenTexts.show+'</a><div class="hidden-text">'+text+'</div>');
	});
	
	$('.show-hidden-text').click(function() {
		var parent = $(this).parent();
		
		var hidden = parent.children('.hidden-text');
		
		if(hidden.is(':visible')) {
			
			hidden.animate({opacity: 0}, {queue: false, duration: 250, complete: function() {
				hidden.hide();
			}});
			
			$(this).html(hiddenTexts.show);
		} else {
			hidden.css({opacity: 0});
			hidden.show();		
			hidden.animate({opacity: 1}, {queue: false, duration: 250, complete: function() {
				
			}});
			
			$(this).html(hiddenTexts.hide);
		}
		
		return false;
	});

});

