function zysk(kwota, okres, okres_typ, oprocentowanie) {
	$("#result").css("display", "none");
	if (kwota == '' || kwota == 0) {
		alert('Brak podanej kwoty');
		$("#zysk_kwota").focus();
		return false;
	}
	if (okres == '' || okres == 0) {
		alert('Brak podanego okresu');
		$("#zysk_okres").focus();
		return false;
	}

	$.post("services/zysk.php", { kwota: kwota, okres: okres, okres_typ: okres_typ, oprocentowanie: oprocentowanie },
	  function(data){
	    $("#result").html(data);
		$("#result").fadeIn("slow");
	  });
}

function naKoncie(kwota, okres, okres_typ, oprocentowanie) {
	$("#result").css("display", "none");
	if (kwota == '' || kwota == 0) {
		alert('Brak kwoty');
		$("#na_koncie_kwota").focus();
		return false;
	}
	if (okres == '' || okres == 0) {
		alert('Brak podanego okresu');
		$("#na_koncie_okres").focus();
		return false;
	}

	$.post("services/na_koncie.php", { kwota: kwota, okres: okres, okres_typ: okres_typ, oprocentowanie: oprocentowanie },
	  function(data){
	    $("#result").html(data);
		$("#result").fadeIn("slow");
	  });
}

