// ŚRODKOWANIE WARSTWY W PIONIE
(function($) {
	$.fn.vAlign = function() {
			return this.each(function(i){
			var ah = $(this).height();
			var ph = $(window).height();
//			var ph = $(this).parent().height();
			var mh = (ph - ah) / 2;
			if (mh<0) {mh = 0;}
			$(this).css('margin-top', mh);
		});
	};
})(jQuery);

$(document).ready(function() {
	$("div.test").vAlign();
});

$(window).bind('resize', function(){
	$("div.test").vAlign();
});


// ŚRODKOWANIE UL (bez określania szerokości) DLA MENU Z LI Z FLOAT LEFT (styl niezbędny dla ul: display: inline; float: left;)
(function($) {
	$.fn.liAlign = function() {
			return this.each(function(i){
			var szerokosc_div = $(this).width();
			var szerokosc_ul = $(this).children().width();
			var margines = (szerokosc_div - szerokosc_ul) / 2;
			$(this).children().css('margin-left', margines);
		});
	};
})(jQuery);

$(document).ready(function() {
	$("div.menu-poziome").liAlign();
});
