
    onload_functions.push('resizeimg()');

    function resizeimg() {
    // Define the allowed width and height
    maxWidth  = 350;
    maxHeight = 350;
    if (document.getElementsByTagName)
    {
        for (i=0; i<document.getElementsByTagName('img').length; i++)
        {
            resize = 0;
            im     = document.getElementsByTagName('img')[i];
            if (im.width >= im.height && im.width > maxWidth && im.alt == "Image")
            {
                // Image width exceeds allowed width
                im.style.padding = "2px";
                im.style.marginBottom = "2px";
                im.style.border = "2px dashed #000000";
                im.style.width = maxWidth + 'px';
                resize         = 1;
            }
            else if (im.height > im.width && im.height > maxHeight && im.alt == "Image")
            {
                // Image height exceeds allowed height
                im.style.padding = "2px";
                im.style.marginBottom = "2px";
                im.style.border = "2px dashed #000000";
                im.style.height = maxHeight + 'px';
                resize          = 1;
            }
            if(resize == 1)
            {
                // The image needs to be resized
                eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width=600,height=600,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 To Enlarge The Image';
            }
        }
   }
}
