function openPreview(image,w,h)
  {
  var bars = ",toolbar=no,location=no,directories=no,status=no,menubar=no";
  var scrollbars=",scrollbars=no,resizable=no";
  var win,left,top,sw,sh;

  if (navigator.appName == "Netscape")
    {
    sh=screen.height;
    sw=screen.width;
    }
  else
    {
    sh=screen.availHeight;
    sw=screen.availWidth;
    }
  h+=20;
  top=(sh>=h)?(sh-h)/2:0;
  left=(sw>=h)?(sw-w)/2:0;
  if (w>sw) {w=sw; scrollbars=",scrollbars=yes,resizable=yes";}
  if (h>sh) {h=sh; scrollbars=",scrollbars=yes,resizable=yes";}
  win=open("","","top="+top+",left="+left+",width=" + (w) + ",height=" + (h) + bars + scrollbars );
  win.innerWidth = w;
  win.innerHeight = h;
  win.focus();

	win.document.open("text/html", "replace");
  win.document.write('<html><head><title>'+image+'</title></head><body bgcolor="#000000" text="#ffffff">'+"\n"+
    '<div name="1" STYLE="position: absolute; LEFT: 10px; TOP: 0px;Z-INDEX=0"><b>Click the image to close the window<b></div>'+"\n"+
    '<div name="1" STYLE="position: absolute; LEFT: 0px; TOP: 20px;Z-INDEX=0">'+"\n"+
    '<a href="#" onclick="self.close();">'+"\n"+
    '<img border=0 alt="Click image to close window." src='+image+'></a></div>'+"\n"+
    '</body></html>'
/*	  +'<div name="2" STYLE="position: absolute; LEFT: 0px; TOP: 0px; Z-INDEX=1"><p><font color="#FF0000">'+
	  	'width='+w+
	  	' height='+h+
	  	' scrollbars="'+scrollbars+'"'+
	  	'</font></p></div>'*/)
  }
