function openImage(imgName, imgTitle, wt, ht, top, left) { wscroll = "no"; if (imgTitle == "::") { ht_addon = 30; } else { // надо расчитывать от длины imgTitle и wt ht_addon = 80; } wwt = wt + 40; wht = ht + ht_addon; if (wht > screen.height - 60) { wht = screen.height - 60; wscroll = "yes" } if (wwt > screen.width) { wwt=screen.width; wscroll = "yes" } // if (!top) top = (screen.height) ? Math.floor((screen.height - ht) / 2) - 30 : 0; // if (!left) left = (screen.width) ? Math.floor((screen.width - wt) / 2) - 30 : 0; if (!top) top = Math.floor((screen.height - wht) / 2) - 40 if (!left) left = Math.floor((screen.width - wwt) / 2) if (top < 0) top = 0; if (left < 0) left = 0; image=window.open("", "fullImage_" + wt, "width=" + wwt + ",height=" + wht + ",top=" + top + ",left=" + left + ",scrollbars=" + wscroll + ",toolbar=no,location=no,status=no,menubar=no,resizable=yes"); image.focus(); // интересная штука: clientHeight не равен размеру, заданному в window.open, а вот clientWidth -- равен // client_mult = image.document.body.clientHeight / ht; // wt = Math.floor(image.document.body.clientWidth * client_mult); // ht = image.document.body.clientHeight; image.document.open(); image.document.write("\n
" + imgTitle + "
\n"); image.document.write("