$(document).ready(
	function()
	{
		if ($('#glowka_aktu').find ('tr').children().size() > 1)
		{
			original_text = $('#glowka_aktu').find ('tr:first').find ('td').html();
			$('#glowka_aktu').find ('tr:first').find ('td').html (original_text+'&nbsp;&nbsp;&nbsp;<a href="#" id="expand_akty" title="rozwiń listę">[+]</a>');
						
			$('#glowka_aktu').find ('tr').hide();
			$('#glowka_aktu').find ('tr:first').show();
		}
	}
);
											
$('#expand_akty').live ('click',
	function()
	{
		$('#glowka_aktu').find ('tr:first').find ('td').html (original_text+'&nbsp;&nbsp;&nbsp;<a href="#" id="collapse_akty" title="zwiń listę\">[-]</a>');
		$('#glowka_aktu').find ('tr').show();
	}
);
$('#collapse_akty').live ('click',
	function()
	{
		$('#glowka_aktu').find ('tr:first').find ('td').html (original_text+'&nbsp;&nbsp;&nbsp;<a href="#" id="expand_akty" title="rozwiń listę">[+]</a>');
		$('#glowka_aktu').find ('tr').hide();
		$('#glowka_aktu').find ('tr:first').show();
	}
);

function mouseX(evt) {
	if (evt.pageX) return evt.pageX;
	else if (evt.clientX)
	   return evt.clientX + (document.documentElement.scrollLeft ?
	   document.documentElement.scrollLeft :
	   document.body.scrollLeft);
	else return null;
}

function mouseY(evt) {
	if (evt.pageY) return evt.pageY;
	else if (evt.clientY)
	   return evt.clientY + (document.documentElement.scrollTop ?
	   document.documentElement.scrollTop :
	   document.body.scrollTop);
	else return null;
}

function show_komentarz(id_div){
	kom = document.getElementById(id_div);
	if ((kom.style.visibility == 'hidden')||(kom.style.visibility == '')){
		kom.style.visibility = 'visible';
	}
	else {
		kom.style.visibility = 'hidden';
	}
}