      function preview(filename, width, height)
      {
        preview_window = window.open('', '_blank', 'width=' + width + ',height=' + height);
        preview_window.document.write('<html><head><style type="text/css">body { margin: 0; }</style></head><body onblur="window.close();">');
        preview_window.document.write('<img name="theimage" src="' + filename + '" width="' + width + '" height="' + height + '" />');
        preview_window.document.write('</body></html>');
        preview_window.document.close();      
      } 