// a function to show the TSVQ synthesis results

function OpenTSVQSynthesisWindow(oImageName, sImageName, tsvqImageName, nameTag)
{
   // create the window
   var features = 'resizable=yes,scrollbars=yes';
   var newWindow = open('', 'textureWindow', features);

   // write the document content
   with(newWindow.document)
   {
      open();
      writeln('<html>');
      writeln('<head>');
      writeln('<center><title>');
      writeln('Texture Synthesis Example: ' + nameTag);
      writeln('</title></center>');
      writeln('<body bgcolor="#FFF8EF">');
      writeln('<center>');
      writeln('<p><table width="100%" height="100%" border=0 cellpadding=0 cellspacing=0>');
      writeln('<td valign=middle align=center>');
      writeln('<p><table border=0 cellspacing=20%>'); 
      writeln('<td align=center><img src="' + oImageName + '"> <br>Original </td>');
      writeln('<td align=center><img src="' + sImageName + '"> <br>Full Searching Synthesis</td>');
      writeln('<td align=center><img src="' + tsvqImageName + '"> <br>TSVQ Synthesis </td>');
      writeln('</table>');

       writeln('<p><table boder=0>');
      writeln('<td align=left><em>Texture Synthesis Example. (Left) texture sample (Middle) synthesis result using full searching (Right) synthesis result using TSVQ</em>');
      writeln('</td>');
      writeln('</table>');

      writeln('</td>');
      writeln('</table>');
      writeln('</center>');
      writeln('</body>');
      writeln('</head>');
      writeln('</html>');
      close();
   }
}
