Ibrin-
This should make the popup the original size of the image, plus 10 pixels for the body margins; if the image is larger than the user's resolution, the popup should become the size of their screen.
Let me know if that works or not; I am looking into adding the text to notify the user that the image has been resized, but that will take more work.
Code:
<script>
window.onload = resizeimg;
function resizeimg()
{
if (document.getElementsByTagName)
{
for (i=0; i<document.getElementsByTagName('img').length; i++)
{
im = document.getElementsByTagName('img')[i];
if (im.width > 768)
{
origW = im.width + 10; // Original Width
if (origW > screen.width) origW = screen.width; // Check if Original Width is too big for user's resolution
origH = im.height + 10; // Original Height
if (origH > screen.height) origH = screen.height; // Check if Original Height is too big for user's resolution
im.style.width = '768px';
eval("pop" + String(i) + " = new Function("pop = window.open('" + im.src + " ','fullscale','width=" + origW + ",height=" + origH + ",scrollbars=1,resizable=1'); pop.focus();")");
eval("im.onclick = pop" + String(i) + ";");
if (document.all) im.style.cursor = 'hand';
if (!document.all) im.style.cursor = 'pointer';
im.title = 'Click Here To See Image Full Size ';
}
}
}
}
</script>