﻿function openWindow(image,width,height) {
    newWindow = null;
    if (window.screen) { awidth = screen.availWidth; aheight = screen.availHeight; } else { awidth = 640; aheight = 480; }
    params = 'width='+width+',height='+height+','
           + 'top='+(aheight-height)/2+',left='+(awidth-width)/2+','
           + 'menubar=no,toolbar=no,location=no,status=no,scrollbars=no,resizable=no';
    newWindow = window.open('','image',params);
    newWindow.document.writeln('<?xml version="1.0" encoding="UTF-8"?>');
    newWindow.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
    newWindow.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl">');
    newWindow.document.writeln('  <head>');
    newWindow.document.writeln('    <title>Powiększenie</title>');
    newWindow.document.writeln('    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />');
    newWindow.document.writeln('  </head>');
    newWindow.document.writeln('  <body style="padding: 0px; margin: 0px;" onload="this.focus()">');
    newWindow.document.writeln('    <img style="display: block;" src="'+image+'" alt="zamknij" onclick="self.close()" />');
    newWindow.document.writeln('  </body>');
    newWindow.document.writeln('</html>');
    newWindow.document.close();
}
