var imgObj = new Image();
function showImgWin(imgName) {
  imgObj.src = imgName;
  setTimeout("createImgWin(imgObj)", 1);
}
function createImgWin(imgObj) {
  if (! imgObj.complete) {
    setTimeout("createImgWin(imgObj)", 1);
    return;
  }
  if (imgObj.width > 825 || imgObj.height > 625) {
    imageWin = window.open("", "imageWin", "scrollbars=yes, width=" + imgObj.width + ",height=" + imgObj.height);
  } else {
    imageWin = window.open("", "imageWin", "width=" + imgObj.width + ",height=" + imgObj.height);	
  }  
  imageWin.document.write("<html><body style='margin:0'>");
  imageWin.document.write("<img name='imgz' src='" + imgObj.src + "' onclick='javascript:self.close();' style='cursor: hand'>");
  imageWin.document.write("<script language='javascript'>\n");
  imageWin.document.write("<!-- // ·Îµù½Ã ÀÌ¹ÌÁöÀÇ Å©±â¿¡ µû¶ó À©µµ¿ìÀÇ »çÀÌÁî¸¦ Á¶Àý\n");
  imageWin.document.write("function ResizePic()\n\n");
  imageWin.document.write("{ \n");
  imageWin.document.write("  if(! imgz.complete) // ÀÌ¹ÌÁö°¡ ´Ù ·ÎµùµÇÁö ¾Ê¾ÒÀ¸¸é \n");
  imageWin.document.write("  {  \n");
  imageWin.document.write("     setTimeout('ResizePic(imgz)',50); // ÇÔ¼ö¸¦ ´Ù½Ã È£Ãâ \n");
  imageWin.document.write("  }   \n");
  imageWin.document.write("  else  \n");
  imageWin.document.write("  {  \n");
  imageWin.document.write("     if(imgz.width > 825 || imgz.height > 650) // ÀÌ¹ÌÁö°¡ 800*600º¸´Ù Å©¸é \n");  
  imageWin.document.write("     {  \n");
  imageWin.document.write("       window.resizeTo(825, 650)  // ÀÌ¹ÌÁö »çÀÌÁî¸¦ 800*600 À¸·Î Ã¢À» resize \n");
  imageWin.document.write("     }  \n");
  imageWin.document.write("     else  \n");
  imageWin.document.write("     {  \n");
  imageWin.document.write("       window.resizeTo(eval(imgz.width)+10, eval(imgz.height)+50)  // ÀÌ¹ÌÁö »çÀÌÁî¿¡ µü ¸Â°Ô Ã¢À» resize \n");
  imageWin.document.write("     }  \n");
  imageWin.document.write("  }  \n");
  imageWin.document.write("}  \n");
  imageWin.document.write("ResizePic(); \n");
  imageWin.document.write("//--> \n");
  imageWin.document.write("</script>\n");
  imageWin.document.write("</body><html>");
  imageWin.document.title = imgObj.src;
}

