
/**
 * Drobne funkcjonalności javascriptowe
 * 
 * @author Michał Wujas
 */
// Rozpocznij wykonywanie po załadowaniu doma
$(document).ready(function()
{
	// anty spam dla formularza z komentarzem do artykułu
	$('#commentForm').attr('method','post');
	
	// zwijanie/rozwijanie miejscowości
	var placesList = $('#places'); 
	var placesContainer = placesList.parent();
	var placesLabel = placesList.prev();
	
	placesList.hide();
	var button = $('<a id="show_places" href="#">').html(placesLabel.html());
	placesLabel.remove();
	
	button.prependTo(placesContainer);
	button.click(function()
	{
		$(this).next().toggle('fast');
		
		return false;
	});
	
	// Wybór gazety z archiwum
	$('#newspaper_nr').change(function()
	{ 
		$(this).parent().submit()
	});
	
	// lewe menu ułatwienie dla cssa
	$('li:last-child').addClass('last');
});
