<!--

function BullStatistic()
{
	var colorDepth = window.screen.colorDepth;
	var res = window.screen.width + "," + window.screen.height;
	var referer = escape(document.referrer);
	document.write('<img src="/statystyka/zlicz.php?colors=' + colorDepth + '&resolution=' + res + '&referer=' + referer + '" style="width:0;height:0;" />');
}

function sprawdzemail(adres) 
{	
  a = adres.value.search(/@/i);
  a1 = adres.value.substring(0,a);
  a2 = a1.length;
  a = a + 1;
  b = adres.value.indexOf(".");
  b1 = adres.value.substring(a,b);
  b2 = b1.length;
  b = b + 1;
  c = adres.value.length;
  c1 = adres.value.substring(b,c);
  c2 = c1.length;
  if(adres.value.indexOf("@") != "-1" && adres.value.indexOf(".") != "-1" && a2 >= 1 && b2 >= 1 && c2 >= 1)
  {
	return true;
  }
  else
  {
	return false;
  }		
}

function kontrola_ilosci(pole,msg) 
{
  WzorN = /^[0-9]{1,4}$/;
  if(!WzorN.test(pole.value))
  {
	window.alert(msg);
	pole.focus();
	return false;
  }
  return true;
}

function sprawdz_form_zam(f)
{
  if(f.klient_email.value.length == 0 || f.klient_imie.value.length == 0 || f.klient_nazwisko.value.length == 0 || f.klient_ulica.value.length == 0 || f.klient_ulica_n1.value.length == 0 || f.klient_kod_pocztowy.value.length == 0 || f.klient_miejscowosc.value.length == 0 || f.klient_tel.value.length == 0) 
  {
	alert("Wypełnij wszystkie pola oznaczone pogrubion± czcionk±!");
	return false;
  }
  if(f.klient_email.value.length != 0)
  {
  	if(sprawdzemail(f.klient_email) == false)
	{
	  alert("Podaj poprawny adres e-mail.");
	  f.klient_email.focus();
	  return false;
	}
  }
  if(!f.regulamin.checked)
  {
    alert("Musisz zapoznać się z regulaminem sklepu i zaakceptować go aby złożyć zamówienie!");
	return false;
  }
	f.elements['przycisk_wyslij'].disabled = true;
	f.elements['przycisk_wyslij'].value = 'proszę czekać...';
	return true;
}

function OtworzOkno(url,width,height)
{
	ScrWidth = 640;
  	ScrHeight = 480;
  	if(window.screen)
  	{
   	ScrWidth = window.screen.width;
		ScrHeight = window.screen.height;
  	}
  	PosX = Math.round((ScrWidth - width) / 2);
  	PosY = Math.round((ScrHeight - height) / 2);
  	window.open(url, "", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=no,copyhistory=no,width="+width+",height="+height+",left=" + PosX + ",top=" + PosY);
}

function Drukuj(id)
{
	var okno = null;
	okno = window.open("drukuj.php?id="+id+"", "wersja_do_druku", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=no,copyhistory=no,width=750,height=600,left=50,top=50");
	okno.focus();
}

function PowiekszZdjecie(url, width, height)
{
	var okno = null;
	if(okno) okno.close();
	ScrWidth = 640;
	ScrHeight = 480;
	if(window.screen)
  	{
   	ScrWidth = window.screen.width; 
		ScrHeight = window.screen.height;
  	}
  	PosX = Math.round((ScrWidth - width) / 2);
  	PosY = Math.round((ScrHeight - height) / 2);
  	width = width;
  	height = height + 2;
  	okno = window.open("", "zdjecie", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
  	okno.document.clear();
	okno.document.write("<html><head><title>Megadisc.pl - Powiększenie zdjęcia</title><meta http-equiv='content-type' content='text/html; charset=ISO-8859-2'></head><style type=\"text/css\">body { margin:0; padding:0; }</style><body><div align=\"center\"><img src=\""+ url +"\" alt=\"Kliknij aby zamkn±ć to okno\" title=\"Kliknij aby zamkn±ć to okno\" border=\"0\" onclick=\"window.close();\" /></div></body></html>");
	okno.document.close();
  	okno.focus();	
}

// -->