
function stan_magazyn (stan, id) {
			var chec = document.getElementById(id).value;
			chec1 = parseInt(chec);
			if ((chec1 <= 0) || (chec == '')) {
				alert ("Musisz podac liczbę większą od 0");
				return(false);
			} else {
				if (chec1 > stan) {
					alert ("Przykro nam ale stan magazynowy jest mniejszy niż podana ilosc. Maksymalnie mozesz kupic " + stan + " produkty");
					document.getElementById(id).focus();
					return(false);
				} else {
					return(true);
				}
			}
		}
function zgoda1() {
	if (document.getElementById("zgod").checked == true) {
		return true;
	} else {
		return false;
	}
}

function firma_pokaz() {
	
		if (document.getElementById("firm").checked == true) {
				return true;
			} else {
				return false;
			}
}
function pokaz () {
	if (aaa == true) {
		if (firma_pokaz()) {
			document.getElementById("ukryte").innerHTML = tabelka();
		} else {
			document.getElementById("ukryte").innerHTML = "";
		}
	}
}
function firma_pokaz2() {
	
		if (document.getElementById("firm").checked == true) {
				return true;
			} else {
				return false;
			}
}
function pokaz2 () {
	if (aaa == true) {
		if (firma_pokaz2()) {
			document.getElementById("ukryte2").innerHTML = tabelka2();
		} else {
			document.getElementById("ukryte2").innerHTML = "";
		}
	}
}
function odblokuj () {
	if (zgoda1()) {
		document.getElementById("but").disabled = false;
	} else {
		document.getElementById("but").disabled = true;
	}
}
