  $(document).ready(function(){

	  $("a[href='#']").click(function(event){
			event.preventDefault();
		});

	$('.job').click(function() {
		$('#praca').fadeIn('slow');
	});
	$('#praca span').click(function() {
		$('#praca').fadeOut('slow');
	});
	$('.form').click(function() {
		$('#form').fadeIn('slow');
	});

	$(function() {
			$(document).ajaxError(function() {
				alert('Nie można wysłać danych lub błąd serwera!');
			});
			$('.formularz').submit(function() {
				var $this = $(this);
				$('.blad, .komunikat').remove();
				if ($this.find('input[name=imie]').val() && $this.find('textarea').val()) {
					$.post($this.attr('action'), $this.serialize(), function(dane) {
						$this.find('input[name=imie], textarea').val('');
						$('<p class="komunikat">' + $(dane).filter('#odp').text() + '</p>')
						.css('background-color', 'yellow')
						.insertBefore($this)
						.fadeOut(3000, function() {
							$(this).remove();
						});
					});
				} else {
					$('<p class="blad">Wypełnij wszystkie pola!</p>')
					.css('color', 'red')
					.insertBefore($this);
				}
				return false;
			});
		});
	
	
  });


