function podglad(url, x, y) {
 okno = window.open("", "o", "width="+x+", height="+y+", left=100, top=25,"
   + " innerwidth="+x+", innerheight="+y+", location=0, directories=0,"
   + " scrollbars=0, menubar=0, toolbar=0, status=0, resizable=1");
 okno.document.open();
 okno.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"');
 okno.document.writeln('"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">');
 okno.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml" ');
 okno.document.writeln('xml:lang="pl"><head><meta http-equiv="Content-type"');
 okno.document.writeln(' content="text/html; charset=iso-8859-2" />');
 okno.document.writeln('<title>Podgl±d</title><style type="text/css"><!--');
 okno.document.writeln('body {margin:0px; padding:0px; background:white;}');
 okno.document.writeln('img {display:block; border:0px;}');
 okno.document.writeln('--></style></head><body>');
 okno.document.writeln('<a href="javascript:self.close()"><img ');
 okno.document.writeln('src="'+url+'" alt="Zamknij" /></a></body></html>');
 okno.document.close();
 okno.focus();
}

function blokuj(t) {
  if (t[t.selectedIndex].value=="0") {
	 document.filtr.rozstaw.disabled=false;
  } else {
	 document.filtr.rozstaw.disabled=true;	
	}
}
function przelacz_jw() {

  if (document.zam.jw.checked) {	
  document.zam.w_imie.value=document.zam.imie.value; 
	document.zam.w_nazwisko.value=document.zam.nazwisko.value; 
	document.zam.w_firma.value=document.zam.firma.value; 
	document.zam.w_miasto.value=document.zam.miasto.value; 
	document.zam.w_kod.value=document.zam.kod.value; 
	document.zam.w_ulica.value=document.zam.ulica.value; 
	document.zam.w_tel.value=document.zam.tel.value;  	
	} else {
	document.zam.w_imie.value=''; 
	document.zam.w_nazwisko.value=''; 
	document.zam.w_firma.value=''; 
	document.zam.w_miasto.value=''; 
	document.zam.w_kod.value=''; 
	document.zam.w_ulica.value=''; 
	document.zam.w_tel.value='';
	}
}
function policz_z() {
  ilosc = document.zam.ilosc.value;
  cena = document.zam.koszt.value;	
  document.getElementById("dozaplaty").innerHTML = ilosc*cena;
	document.zam.dozaplaty2.value=ilosc*cena;
}
function przelacz_t() {
  if (navigator.appName=="Microsoft Internet Explorer"
      && navigator.userAgent.indexOf("Opera")==-1) {
    typ = "block";
  } else {
    typ = "table-row";
  }

  if (document.zam.typ.value=='inne') {
    document.getElementById("samochod_inne").style.display=typ;

  } else {
    document.getElementById("samochod_inne").style.display="none";

  }
}
function przelacz_f() {
  if (navigator.appName=="Microsoft Internet Explorer"
      && navigator.userAgent.indexOf("Opera")==-1) {
    typ = "block";
  } else {
    typ = "table-row";
  }

  if (document.zam.cf.checked) {
    document.getElementById("faktura_firma").style.display=typ;
		document.getElementById("faktura_nip").style.display=typ;

  } else {
    document.getElementById("faktura_firma").style.display="none";
		document.getElementById("faktura_nip").style.display="none";

  }

	
}
function pokaz(opcja) {
  if (navigator.appName=="Microsoft Internet Explorer" 
	 && navigator.userAgent.indexOf("Opera")==-1) {
    typ = "block";
  } else {
    typ = "table-row";
  }
	
  switch(opcja){
	case('loguj'):
		document.getElementById("szukaj_form").style.display="none";
		document.getElementById("loguj_form").style.display=typ;
	break;
	case('szukaj'):
		document.getElementById("szukaj_form").style.display=typ;
		document.getElementById("loguj_form").style.display="none";
	break;	
	default:
    document.getElementById("loguj_form").style.display=typ;
		document.getElementById("szukaj_form").style.display="none";
  }	
}


