noweOkno = null;
function powieksz(src, w, h, tytul){
  if(window.screen){
    aw=screen.availWidth;
    ah=screen.availHeight;
  }else{
    aw=640;
    ah=450;
  }
  if (noweOkno!=null&&(!noweOkno.closed))
  {
  	noweOkno.window.close();
  }
  if(noweOkno==null || noweOkno.closed)
  {
    ustawienia=
     "left=" + (aw-w)/2 + ","
    +"top=" + (ah-h)/2 + ","
    +"screenX=" + (aw-w)/2 + ","
    +"screenY=" + (ah-h)/2 + ","
    +"width=" + w + ","
    +"height=" + h + ","
    +"innerWidth=" + w + ","
    +"innerHeight=" + h + ","
    +"toolbar=no,"
    +"location=no,"
    +"directories=no,"
    +"status=no,"
    +"menubar=no,"
    +"scrollbars=no,"
    +"resizable=no"
    noweOkno = window.open('','obrazek',ustawienia);
  }
  noweOkno.document.open();
  noweOkno.document.clear();
  noweOkno.document.write(
	"<html><head>\n"
	+"<title>" + tytul + "</title>\n"
	+"<script language='javascript'>\n"
	+"<!-- Original:  Gilbert Davis -->\n"
	+"<!-- Begin\n"
	+"function loadImages() {\n"
	+"if (document.getElementById) {  // DOM3 = IE5, NS6\n"
	+"document.getElementById('hidepage').style.visibility = 'hidden';\n"
	+"}\n"
	+"else {\n"
	+"if (document.layers) {  // Netscape 4\n"
	+"document.hidepage.visibility = 'hidden';\n"
	+"}\n"
	+"else {  // IE 4\n"
	+"document.all.hidepage.style.visibility = 'hidden';\n"
	+"      }\n"
	+"   }\n"
	+"}\n"
	+"//--\>"
	+"</script>\n"
	+"</head><body bgcolor='#FFFFFF' onload='loadImages()' marginwidth='0' marginheight='0' topmargin='0' leftmargin='0' rightmargin='0' bottommargin='0'>\n"
	+"\n"
	+"\n"
	+"<div id='hidepage' style='position: absolute; left:5px; top:5px; height: 80%; width: 80%;'>\n"
	+"<table width='80%'>\n"
	+"	<tr>\n"
	+"		<td style='font-family:Tahoma; font-size:10px; font-weight:bold'>Loading... Please wait...</td>\n"
	+"	</tr>\n"
	+"</table>\n"
	+"</div>\n"
	+"<img src='" + src + "' alt='" + tytul + "' border='0' onclick='javascript:window.close()'>\n"
	+"\n"
	+"\n"
  );
  noweOkno.document.close();
  noweOkno.focus();
}



function sprawdz(formularz) {
	for (i = 0; i < formularz.length; i++) {
		var pole = formularz.elements[i];
		if((pole.type == "text" || pole.type == "password" || pole.type == "textarea") && pole.value == "") {
			alert("Nie wszystkie wymagane pola zostały wypełnione!");
			return false;
		}
	}
	return true;
}
