function validatePlatnosc()
{
	var valRadio;
	var radioObj = payform.pay_type;
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			varRadio = radioObj.value;
		else
			valRadio = "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			valRadio = radioObj[i].value;
		}
	}
	
	if(valRadio==null||valRadio=="")
	{
		alert("Wybierz formę płatności!");
		return false;
	}
	if(document.getElementById('credit').checked) {
		if(document.getElementById('credit_first_name').value == "" || document.getElementById('credit_last_name').value == "" || document.getElementById('credit_email').value == "") {
			alert("Dla płatności kartą musisz podać imię, nazwisko oraz adres e-mail!");
			return false;
		}
	}
	return true;
}
