function addRowListeners(tableIdentifier) {
	$(tableIdentifier + ' tr').click(function() {
		selectDetailCard(this);
	});
}

function selectFirstCard(tableIdentifier) {
	if ($(tableIdentifier + ' tr:visible').length) {
		selectDetailCard($(tableIdentifier + ' tr:visible').first(), true);
	}
}

function selectDetailCard(me, initializing) {
	$(me).parent().children('tr.active').removeClass('active');
	$(me).addClass('active');
	var rowId = $(me).attr('id');
	$('#' + rowId + '-card').show();
	var arrayIndex = parseInt(rowId.split('-')[1]);
	var type = $(me).parents('table').attr('id');
	var element = results[type][arrayIndex];
	$.ajax({
		url: '/search/renderCard',
		method: 'POST',
		data: {
			json: JSON.stringify(element),
			type: type
		},
		success: function(data) {
			$('#' + type + '-card').html(data);
			$('#' + type + '-card [data-content]').popup({
				position: 'top center'
			});
		}
	});
}

function jump(h) {
	var top = document.getElementById(h).offsetTop;
	window.scrollTo(0, top);
}

@@ -291,16 +291,109 @@
 true);%0D%0A
+%09%7D else %7B%0D%0A%09%09var type = $(tableIdentifier).attr('id');%0D%0A%09%09$('#' + type + '-card').html('');%0D%0A
 %09%7D%0D%0A%7D%0D%0A%0D

Remove currently shown card when all results are filtered out.