function dRec() {
    if (document.f2.rec[0].checked==true) {
		 document.getElementById('company').readOnly=true;
		 document.getElementById('NIP').readOnly=true;		
	 } else {
		 document.getElementById('company').readOnly=false;	 
		 document.getElementById('NIP').readOnly=false;	 
	 }
}

function help(id, v) {
	if (v == 1)
		document.getElementById('h1').style.display="none";		
		document.getElementById('h2').style.display="none";				
		document.getElementById(id).style.display="block";		
	if (v == 0) {
		document.getElementById(id).style.display="none";		
		document.getElementById('h1').style.display="none";		
		document.getElementById('h2').style.display="none";				
	}
}

function sprawdz(f1) {
  if (f1.p1.value !="" && f1.p2.value !="" && f1.p1.value == f1.p2.value) {
    return true;
  }
  else {
    alert("Hasła nie są takie same, wpisz je ponownie");
    f1.p1.value="";
    f1.p2.value="";
    f1.p1.focus();
    f1.p1.style.backgroundColor="#ffcccc";	 
    f1.p2.style.backgroundColor="#ffcccc";	 	 
    return false;
  }
}

function orderCheck() {

  var ch1 = "";
  var ch2 = "";
		
  for (i=0; i<document.o.pMethod.length; i++) {
    if (document.o.pMethod[i].checked) {
		 ch1 = 1;
		 }
  }

  for (i=0; i<document.o.aMethod.length; i++) {	
    if (document.o.aMethod[i].checked) {
		 ch2 = 1;
		 }
  }

	if (ch1 == "" && ch2 == "") {
	 alert("Wybierz sposób płatności i dostawy.");	
	 return false;
	} 
	if (ch1=="") {
	 alert("Wybierz sposób płatności.");
	 return false;
	}if (ch2=="") {
	 alert("Wybierz sposób odbioru.");
	 return false;
	}
	
}