function sendForm(id, name)
{
	
	if ( $("#adres_ulica").val().length < 4 || $("#adres_kod").val().length < 5 || $("#adres_miasto").val().length < 4)
	{

		alert("Wpisz poprawnie adres!");
		return false;
		
	}
	
	if ( $("#telefon").val().length < 9 ) {

		alert("Wpisz poprawnie numer telefonu");
		return false;
		
	}

	if ($("#email").val().length < 8)
	{

		alert("Zły adres poczty elektronicznej");
		return false;
		
	}
	
	if ($("#kontakt").val().length < 4)
	{

		alert("Uzupełnij imię i nazwisko osoby upoważnionej do złożenia zamówienia");
		return false;
		
	}
	
	if (name == "wyslij_zlecenie")
	{

		input = document.createElement("input");
		input.type = "hidden";
		input.value = id;
		input.name = "wyslij_zlecenie";
		document.getElementById(id).appendChild(input);
		
		$("#zamowienie_send").show();
		$("#zlecenie_druku").hide();
		
	}

	document.getElementById(id).submit();
	
}

function procent(l)
{
	
	if ( l.length == 1 )
	{
		
		return parseFloat("0.0" + l);
		
	}
	else
	{
	
		return parseFloat("0." + l);
		
	}
	
}

function sprawdzKod(id)
{

	document.getElementById(id).value = document.getElementById(id).value.replace(new RegExp("[^0-9\-]{1,}", "gi"), '');
	
}
