function snewsletter(){
	if (document.newsletterform.email.value == ''){
		alert('Proszę wpisać adres email !');
		document.newsletterform.email.focus();
	} else {
		if ((document.newsletterform.email.value.indexOf("@")==document.newsletterform.email.value.lastIndexOf("@"))&&(document.newsletterform.email.value.charAt(document.newsletterform.email.value.indexOf("@")+1) != '.')&&(document.newsletterform.email.value.charAt(document.newsletterform.email.value.indexOf("@")-1) != '.')&&(document.newsletterform.email.value.indexOf("@") != 0)&&(document.newsletterform.email.value.indexOf(".") != 0)&&(document.newsletterform.email.value.lastIndexOf(".") > document.newsletterform.email.value.indexOf("@"))){
			document.newsletterform.submit();
		} else {
			alert('Proszę wpisać poprawnie adres email !');
			document.newsletterform.email.focus();
		} 
	}
}


var ie=document.all;
var nn6=document.getElementById&&!document.all; 


function pokaz(warstwa){
	if (nn6){
		document.getElementById(warstwa).style.visibility = "visible"; 
		document.getElementById(warstwa).style.display = "block";	
	} else {
		document.all[warstwa].style.visibility = "visible"; 
		document.all[warstwa].style.display = "block";
	}
}

function zaslon(warstwa){
	if (nn6){
		document.getElementById(warstwa).style.visibility = "hidden"; 
		document.getElementById(warstwa).style.display = "none";		
	} else {
		document.all[warstwa].style.visibility = "hidden"; 
		document.all[warstwa].style.display = "none";
	}
} 

function zamow(send){
	document.mainform.send.value=send;
	if (send == 1)
	{
		if (document.mainform.czas_firma.value == '' && document.mainform.person[1].checked){
			alert('Proszę wypełnić pole "Nazwa firmy" !');
			document.mainform.czas_firma.focus();
		} else if (document.mainform.czas_name.value == ''){
			alert('Proszę wypełnić pole "Imię" !');
			document.mainform.czas_name.focus();
		} else if (document.mainform.czas_surname.value == ''){
			alert('Proszę wypełnić pole "Nazwisko" !');
			document.mainform.czas_surname.focus();
		} else if (document.mainform.czas_city.value == ''){
			alert('Proszę wypełnić pole "Miasto" !');
			document.mainform.czas_city.focus();
		} else if (document.mainform.czas_post_code.value == ''){
			alert('Proszę wypełnić pole "Kod" !');
			document.mainform.czas_post_code.focus();
		} else if (document.mainform.czas_street.value == ''){
			alert('Proszę wypełnić pole "Ulica" !');
			document.mainform.czas_street.focus();
		} else if (document.mainform.czas_phone.value == ''){
			alert('Proszę wypełnić pole "Numer tel." !');
			document.mainform.czas_phone.focus();
		} else if (document.mainform.czas_email.value == ''){
			alert('Proszę wypełnić pole "E-mail" !');
			document.mainform.czas_email.focus();
		} else if (document.mainform.czas_nip.value == '' && document.mainform.person[1].checked){
			alert('Proszę wypełnić pole "Nip" !');
			document.mainform.czas_nip.focus();
		} else if (document.mainform.czas_dane_do_wysylki.value == ''){
			alert('Proszę wypełnić pole "Dane do wysyłki" !');
			document.mainform.czas_dane_do_wysylki.focus();
		} else {
			if ((document.mainform.czas_email.value.indexOf("@")==document.mainform.czas_email.value.lastIndexOf("@"))&&(document.mainform.czas_email.value.charAt(document.mainform.czas_email.value.indexOf("@")+1) != '.')&&(document.mainform.czas_email.value.charAt(document.mainform.czas_email.value.indexOf("@")-1) != '.')&&(document.mainform.czas_email.value.indexOf("@") != 0)&&(document.mainform.czas_email.value.indexOf(".") != 0)&&(document.mainform.czas_email.value.lastIndexOf(".") > document.mainform.czas_email.value.indexOf("@"))){
				document.mainform.submit();
			} else {
				alert('Proszę wypełnić poprawnie pole "E-mail" !');
				document.mainform.czas_email.focus();
			} 
		}
	} else {
		document.mainform.submit();
	}
} 

function wybierz(){
	document.mainform.send.value='';
	document.mainform.pid.value=684;
	document.mainform.submit();	
} 

function change(){
	if (document.mainform.czas_pren.value == 1)
	{
		pokaz('war1');
	} else {
		zaslon('war1');
	}
} 