function showPopup(popup) {
	
	currentOffset2 = 0;
	currentOffset = document.documentElement.scrollTop || document.body.scrollTop;
	var windowHeight;
	if (!($.browser.opera)) { windowHeight = document.documentElement.clientHeight } else { windowHeight = document.body.clientHeight }
	if ($('.mainWrapper').height() > windowHeight ) { $('#black').height($('.mainWrapper').height()); }
	else { $('#black').height(windowHeight); }
	$('#black').show();
	$('#'+popup).show();
	$('#'+popup).width($("#"+popup+" .photoWrapper img").width());
	$("#podpis_foto").width($("#"+popup+" .photoWrapper img").width() - 260);
	$("#"+popup+" h2").width($("#"+popup).width() - 20);
	pLeft = -30+(document.body.clientWidth - $('#'+popup).width()) / 2;
	$('#'+popup).css({left:pLeft});
	
	if (windowHeight < $('#'+popup).height()) {
		currentOffset = (currentOffset + 10);
	} else {
		currentOffset2 = parseInt((windowHeight - $('#'+popup).height()) / 2);
	}
	$('#'+popup).css({top:currentOffset+currentOffset2});
}