function otworz_pionowe(adres, w, h) 
{
noweOkno = window.open(adres, null, 'width=' + (w + 50) + ', height=' + (h + 70)+', scrollbars=yes, menubar=0,toolbar=0,location=0,directories=0,status=0') 
} 


var popupImageHandle = null;
function popupImage(src, title, w, h, author) {
    if (popupImageHandle && !popupImageHandle.closed) popupImageHandle.close();
    var s = 'toolbar=no, menubar=no, location=no, personalbar=no, scrollbars=no, directories=no, status=no, resizable=no, width=' + (w + 20) + ', height=' + (h + 70);
    var img = '<a href="javascript: void(0)" title="Zamknij" onclick="window.close()"><img src="'+src+'" border=0 width="'+w+'" height="'+h+'" style="border: 1px solid #ccc"></a>';
    var descr = '<div style="text-align: center">' + title + '</div><div style="text-align: right; color: #999; font-style: italic;">' + author + '</div>';
    popupImageHandle = win = window.open('', 'null', s);
    win.document.open();
    win.document.write('<html><head><title>' + title + '</title><meta http-equiv=imagetoolbar content=no></head><body style="margin: 10px; color: #666; font-family: Verdana, Arial, sans-serif; font-size: 10px; background: url(./images/tlo.gif) repeat-x; overflow: hidden" onkeypress="if (event && event.keyCode==27) self.close()">' + img + descr + '</body></html>');
    win.document.close();
    win.focus();
}

var popupHandle = null;
function popupCenterWindow(src, w, h, menu) {
  if (!w) w=760;
  if (!h) h=440;
  if (!menu) menu='no';
  if (document.all) {
    // window no border
    var tmp = document.getElementsByTagName("HTML");
    var html = tmp[0];
    var xOffset = window.screenLeft + (html.offsetWidth-w)/2;
    var yOffset = window.screenTop + (html.offsetHeight-h-80)/2;
  } else {
    // window border, same as parent
    var xOffset = window.screenX + (window.outerWidth-w)/2;
    var yOffset = window.screenY + (window.outerHeight-h-50)/2;
  }
  //
  xOffset = Math.max(0, Math.min(screen.availWidth-w, Math.round(xOffset) ) );
  yOffset = Math.max(0, Math.min(screen.availHeight-h-80, Math.round(yOffset) ) );
  //
  if (popupHandle && !popupHandle.closed) popupHandle.close();
  var s = 'toolbar=no,menubar=' + menu + ',personalbar=no,scrollbars=yes,status=yes,directories=no,resizable=no';
	popupHandle = window.open(src, 'null', s+',height='+h+',width='+w+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset);
}

