/**
* zeruje caly koszyk
*/	
	function kasuj_zamowienie(){
		if (confirm('Czy na pewno chcesz usunac cale zamówienie?')) {
			document.getElementById('kasowanie').value='1';
			document.forms[1].submit();
		}
	}	
	
/**
 *wpisuje 0 do input o podanym identyfikatorze
 * wywolywane przez nacisniecie ikony kosza w "Twoj koszyk"
*/ 
function wyrzuc_z_koszyka(ktory) {
	document.getElementById(ktory).value = 0;
}

/**
* przeladowuje strone - skok pod wskazany adres
*/
function przeladuj(adres) {
	document.location.href=adres;
}

/**
* zmienia status elementu "wyslij zamowienie" na niedostepny po wprowadzeniu jakichkolwiek zmian w zamowieniu zbiorczym
*/
function disable_send(item1_id, item2_id) {
	document.getElementById('wyslij_zamowienie_1').disabled = true;
	document.getElementById('wyslij_zamowienie_2').disabled = true;
}

/**
* sprawdza poprawnosc danych wprowadzonych przez klienta wysylajacego zamowienie
*/
function ValidateForm_daneKontrahenta()
{
	if(document.getElementById('formularz').imie.value == "")
	{
		alert("Proszę podać imię osoby zamawiającej lub kontaktowej");
		return false
	}
	if(document.getElementById('formularz').nazwisko.value == "")
	{
		alert("Proszę podać nazwisko osoby zamawiającej lub kontaktowej");
		return false
	}
	if(document.getElementById('formularz').nazwa_firmy.value == "")
	{
		alert("Proszę podać nazwę firmy");
		return false
	}
	if(document.getElementById('formularz').adres_e_mail.value == "")
	{
		alert("Proszę podać adres e-mail");
		return false
	}
	if ((document.getElementById('formularz').adres_e_mail.value.indexOf("@") == -1) || (document.getElementById('formularz').adres_e_mail.value.indexOf(".") == -1))
	{
		alert("Proszę podać poprawny adres e-mail");
		return false
	}
	if(document.getElementById('formularz').adres_firmy.value == "")
	{
		alert("Proszę podać adres firmy");
		return false
	}
	if(document.getElementById('formularz').numer_tel.value == "")
	{
		alert("Proszę podać numer telefonu");
		return false
	}
	if(document.getElementById('formularz').nip.value == "")
	{
		alert("Proszę podać NIP firmy");
		return false
	}
	if(document.getElementById('formularz').termin_realizacji.value == "")
	{
		alert("Proszę podać termin realizacji");
		return false
	}
	if(document.getElementById('formularz').forma_platnosci.value == "")
	{
		alert("Proszę podać formę płatności");
		return false
	}
	if ((document.getElementById('formularz').rodzaj_transportu[0].checked) && (document.getElementById('formularz').nazwa_przewoznika.value == "")){
		alert("Proszę podać nazwę przewoźnika");
		return false
	}
	if ((document.getElementById('formularz').rodzaj_transportu[0].checked) && (document.getElementById('formularz').numer_klienta.value == "")){
		alert("Proszę podać numer klienta");
		return false
	}
		
	return true;
}