nn4 = (document.layers) ? true:false;
ie4 = (document.all) ? true:false;

v4 = ie4||nn4

function max()
{
 var nOkno = null;
 
 oknoS = screen.width;
 oknoW = screen.height;
 
  if(nn4)
  {
  parametry='toolbar=no,location=0,directories=0,status=no,menubar=0,scrollbars=yes,resizable=0,width='+(oknoS-10)+',height='+(oknoW-28)+',screenX=0,screenY=0'           	    
  }

 if (nn4)
  {
   nOkno=window.open("ramki.php","duze",parametry);
   parent.close();
   }
 else
  if (ie4)
   {
    nOkno=window.open("ramki.php","duze","menubar=no,status=no,top=0,left=0,fullscreen=1");
    parent.close();
   }
  else
   {
    nOkno=window.open("ramki.php","duze");
    parent.close();
   }

}

function mini()
{
 var nOkno = null;
 
 oknoS = screen.width;
 oknoW = screen.height;

 if (ie4)
  {
  parametry='directories=yes, location=yes, menubar=yes, scrollbars=yes, status=yes, toolbar=yes, resizable=0,width='+(oknoS+2)+',height='+oknoW+',left=0,top=0'
  }
 if(nn4)
  {
  parametry='toolbar=yes,location=1,directories=0,status=yes,menubar=1,scrollbars=yes,resizable=0,width='+(oknoS-10)+',height='+(oknoW-135)+',screenX=0,screenY=0'           	    
  }

 if (nn4)
  {
   nOkno=window.open("ramki.php","nowe",parametry);
   parent.close();
  }
 else 
  if (ie4)
   {
    nOkno=window.open("ramki.php","nowe",parametry);
    parent.close();
   }
  else 
   {
    nOkno=window.open("ramki.php","nowe");
    parent.close();
   }
  
}

function zamknij()
{
parent.close();
}

function popup( url, w, h )
{
	var last, scrl=false;
	if( last ) last.close();

	sw = screen.availWidth;
	sh = screen.availHeight;

	if( w >= sw-30 ){ w = sw-30; scrl = true; h+=16 }
	if( h >= sh-50 ){ h = sh-50; scrl = true; w+=16 }

	var popup = "";
	var l = ( sw / 2 ) - (w/2);
	var t = ( sh / 2 ) - (h/2);

	popup = window.open( '', '_blank', 'height='+h+',width='+w+',screenX=150,screenY=150,top='+t+',left='+l+',toolbar=no,directories=no,status=no,menubar=no,scrollbars=' + ( scrl ? 'yes' : 'no' ) + ',resizable=yes')

	popup.document.write(
		'<html>'+
			'<head>'+
			'<title>'+url+'</title>'+
		'</head>'+
		'<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor=black onclick="window.close()">'+
			'<table width=100% cellpadding=0 cellspacing=0 border=0>'+
			'<tr>'+
				'<td align=center valign=center>'+
					'<a href="javascript:window.close()" title="kliknij aby zamknac okienko">'+
					'<img src="'+url+'" border=0></a>'+
				'</td>'+
			'</tr>'+
			'</table>'+
		'</body>'+
		'</html>'
	);

	last = popup;
	popup.focus();
}
