var timer=null;

function ViewImg(imgsrc,w,h)
{
    if (window.imgwnd){ // if already defined
       if (!imgwnd.closed) imgwnd.close(); // close old
    }
		w = w + 30;
		h = h + 42;
    imgwnd=window.open("","ImageWindow","resizable=yes,scrollbars=yes");
    with (imgwnd) {
      document.open();
      document.writeln('<html><title> </title>');
			
      document.writeln('<body leftmargin=0 topmargin=0 bgcolor=White>');

			document.writeln('<script language="JavaScript"><!--');
      document.writeln('window.resizeTo('+w+','+h+');');
      document.writeln('//--></script>');
			
      document.writeln('<div style="position:absolute; left:0px; top:0px">');
      document.writeln('<a href="javascript:window.close();parent.focus();">');
      document.writeln('<img border=0 src="'+imgsrc+'" alt="">');
      document.writeln('</a></div></body></html>');
      document.close();
    }
    clearTimeout(timer);
    timer=setTimeout('window.imgwnd.close()',100000);
}


