winstrona = null;

function strona(plik_strony,w,h,przewijanie,bar,adres,statusbar){
    if (!plik_strony) {plik_strony='about:blank';}
    if (!w) {w=450;}
    if (!h) {h=240;}
	if (!przewijanie) {przewijanie='no';}
	if (!bar) {bar='no';}
        if (!adres) { adres='no'; }
        if (!statusbar) { statusbar='no'; }
  if(window.screen){
    aw=screen.availWidth;
    ah=screen.availHeight;
  }else{
    aw=640;
    ah=450;
  }
  if(winstrona==null || winstrona.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=" + adres + ","
    +"directories=no,"
    +"status=" + statusbar + ","
    +"menubar=" + bar + ","
    +"scrollbars=" + przewijanie + ","
    +"resizable=no"
	parent.window.name="netia";
    winstrona = window.open(plik_strony,'',ustawienia);
  }
   if(winstrona==null || winstrona.closed || winstrona.closed || winstrona== 'failed')
  {
  alert('Proszę wyłączyć blokadę okienek popup.');
  }
}


winobrazek = null;
function obrazek(src, w, h, tytul){
  if(window.screen){
    aw=screen.availWidth;
    ah=screen.availHeight;
  }else{
    aw=640;
    ah=450;
  }
  if(winobrazek==null || winobrazek.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"
    winobrazek = window.open('','obrazek',ustawienia);
  }
  if(winobrazek==null || winobrazek.closed || winobrazek.closed || winobrazek== 'failed')
  {
  alert('Proszę wyłączyć blokadę okienek popup.');
  } else { 
  winobrazek.document.open();
  winobrazek.document.clear();
  winobrazek.document.write(
     "<html><head>\n"
	+"<title>" + tytul + "</title>"
	+"<meta name=Pragma content=no-cache>\n"
	+"<meta http-equiv=\"Refresh\" content=\"300\">\n"
    +"<style><!--\n"
    +"body{background-repeat:no-repeat}\n"
    +"--></style>\n"
    +"</head>\n"
    +"<body scroll=no marginheight=0 topmargin=0 leftmargin=0 marginwidth=0>"
	+"<a href=\"javascript:window.close()\">"
	+"<img src='" + src + "' width="+w+" height="+h+" border=0 alt=\"Kliknij aby zamknąć okno\">"
	+"</a>"
	+"</body>\n"
    +"</html>"
  );
  winobrazek.document.close();
  winobrazek.focus();
	}
}


