/*
   JavaScript Function "enlargeIt"
   Arguments: Image URL (abs/rel), Image Width (int), Image Height (int).
   Displays an image in a popup window, adjusting the window size to fit the image.
   Version 1.0 - Currently Supporting Netscape & MS-IE Browsers Only
   Copyright © 2001 by David J. Melville <webmaster@spiritofphoenix.org>. All Rights Reserved.
   You are free to glean this scripts as long as this copyright notice stays intact.
*/
function enlargeIt(imgUrl,imgWidth,imgHeight) {
    /*
       Default screen size to 640x480 for any/unsupported browser,
       and window size to 15x15 larger than image to account for scrollbars
    */
    scrnWidth = 640;
    scrnHeight = 480;
    winWidth = imgWidth+15;
    winHeight = imgHeight+15;
    /*
       Get actual screen size for supported browsers
    */
    thisBrowser=navigator.appName;
    if ((thisBrowser.indexOf("Netscape")!=-1)&&(navigator.javaEnabled())) {
        scrnWidth=java.awt.Toolkit.getDefaultToolkit().getScreenSize().width;
        scrnHeight=java.awt.Toolkit.getDefaultToolkit().getScreenSize().height;
    } else {
        if (thisBrowser.indexOf("Microsoft")!=-1) {
            scrnWidth=screen.width;
            scrnHeight=screen.height;
        }
    }
    /*
       Subtract 10% from screen height to adjust for titlebar and taskbar
    */
    scrnHeight = scrnHeight-Math.round(scrnHeight*0.1);
    /*
       Finally, make sure window dimensions are not bigger than screen!!!
    */
    if (winHeight > scrnHeight) {
        winHeight = scrnHeight
    }
    if (winWidth > scrnWidth) {
        winWidth = scrnWidth
    }
    /*
       Open popup window and generate dynamic HTML to display the image
    */
    openWidth = winWidth.toString();
    openHeight = winHeight.toString();
    openFeatures ='width='+openWidth+',height='+openHeight+',directories=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0';
    var w = window.open('','Enlarged',openFeatures)
    var d = w.document;
    d.write('<HTML>\n<HEAD>\n<TITLE>Enlarged Image</TITLE>\n</HEAD>\n');
    d.write('<BODY bgcolor=\"#000000\" leftmargin=0 topmargin=0 marginheight=0 marginwidth=0>\n');
    d.write('<A href=\"javascript:window.close()\"><IMG src=\"'+imgUrl+'\" border=0 alt=\"Click anywhere to close this window\"></A>\n');
    d.write('</BODY>\n</HTML>');
    d.close();
}