/* Pop-up windows for screenshot display. */

var imgWindow;

function showImg (img, w, h) {
    w+=10; h+=10;
    imgWindow = window.open('','auctex_screenshot','height='+h+',width='+w+','+
                            'resizable=0,location=0,menubar=0,toolbar=0,'+
                            'directories=0,scrollbars=0,status=0');
    w-=10; h-=10;
    doc = imgWindow.document;
    doc.write('<?xml version="1.0" encoding="ISO-8859-1"?>\n'+
              '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" '+
              '"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n'+
              '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\n'+
              '<head>\n'+
              '<title>AUCTeX screenshot</title>\n'+
              '<style type="text/css"><!--\n'+
              'html body {margin:5px; background-color:#f0f0ea;}\n'+
              'img {display:block; border:0px;}\n'+
              '\/\/--></style>\n'+
              '</head>\n'+
              '<body>\n'+
              '<div>\n'+
              '<a href="" title="Click image to close" '+
              'onclick="self.close()">\n'+
              '<img src="'+img+'" width="'+w+'" height="'+h+'" alt="" />\n'+
              '</a>\n'+
              '</div>\n'+
              '</body>\n'+
              '</html>\n');
    doc.close();
    imgWindow.focus();
}
