
function pop(url,windowName,windowTitle,closeOnClick,width,height,t){
  if(!url)return
  function readSize(){if(t.complete)showPopup(t.width,t.height);else setTimeout(readSize,1e2)}
  function showPopup(w,h){with(window.open('',windowName||'','width='+(width||w)+',height='+(height||h)).document){open();write('<html><head><title>'+(windowTitle||'')+'</title></head><body style="margin:0;padding:0"><img src="'+url+'" style="display:block'+(closeOnClick?';cursor: pointer" onclick="self.close()" title="Zamknij okno"':'"')+'></body></html>');close()}}
  if(!width||!height)t=new Image(),t.src=url,readSize()
  else showPopup(width,height)
}

function help(text,width,height){
  function showPopup(w,h){
    with(window.open('','Pomoc','width='+(width)+',height='+(height)+', top=15, left=15').document){
      open();
      write('<html><head><title>Pomoc</title></head><body style="margin:0;padding:0;background-color:#f5f5f5;padding:5px;margin:5px;">'+text+'</body></html>');
      close();
    }
  }
  showPopup(width,height)
}

function popup(file,w,h){
  okienko = null;
  if(window.screen){
    aw = screen.availWidth;
    ah = screen.availHeight;
  } else {
    aw=640;
    ah=480;
  }
  tech="width="+w+",height="+h+",left="
  +(aw-w)/2+",top="
  +(ah-h)/2 
  +",toolbar=no,location=no,directories=no,"
  +"status=no,menubar=no,"
  +"scrollbars=yes,resizable=no";
  okienko=window.open(file,'popup',tech);
}

var globalID;
function showclose(pid){
	if (globalID!=null){
		document.getElementById(globalID).style.display = 'none';
	}
	if(document.getElementById('1').style.display == 'block'){
    document.getElementById('1').style.display = 'none';
  }
	if (document.getElementById(pid).style.display == 'none') {
    document.getElementById(pid).style.display = 'block';
    globalID = pid;
	} else {
    document.getElementById(pid).style.display = 'none';
	}
}
