// pops photos into pre-siszed windows, pre-centered on the screen


	<!-- Hide the following script from older browsers
		
// What the viewPic function does
// Uses img as a parameter (the picture file we want to load into the new window);
// defines an Image variable called picfile, assigns the source of picfile to img,
// and calls the next function, fileCheck.
function viewPic(img)
{ 	
    picfile = new Image(); 
    picfile.src =(img); 
    fileCheck(img); 
}


// What the fileCheck function does
// Uses img as a parameter, see if picture file
// has both a height and width greater than zero.
// If so, call the next function, otherwise,
// try again for a while longer - maybe something is still loading.
function fileCheck(img)
{ 	
    if( (picfile.width!=0) && (picfile.height!=0) )
    { 
        makeWindow(img); 
    }
    else 
    {
        funzione="fileCheck('"+img+"')"; 
        intervallo=setTimeout(funzione,50); 
    }
}

// What the makeWindow function does
// Here's where the fun begins. Still using img,
// we know that it exists and has a height and width.
// Set variable wd (width) to the width of the picture
// plus 18 pixels to give a little room on the side.
// Set variable ht (height) to picture height plus 18.
// This will make it line up nicely in the new window
// (at least for IE and Firefox browsers).
// Assign args (arguments, or parameters) for height,
// innerHeight, width, and innerWidth.
// These all have to do with the dimensions of the window we want to pop up.
//
// If "window.screen" is true
// (meaning, the machine detects that the viewer
// is using a browser that is compatible with Internet Explorer 4+),
// we can also center the window. The program checks the dimensions
// of the user's screen, accounting for the space used
// at the top and bottom of the browser for menus and status,
// finds the center, and feeds in the parameters (args) for where to make the window appear.
//
// The last line opens a new window with img as the content,
// '' for the name, and the args for dimensions and window
// options (in this case, we want to let the user resize
// the window if they want). Other options (address bar, scrollbars, etc.)
// would just get in the way and distract from the lovely picture.
function makeWindow(img)
{ 	
    ht = picfile.height + 20;
    wd = picfile.width + 20; 

    var args= "height=" + ht + ",innerHeight=" + ht; 
    args += ",width=" + wd + ",innerWidth=" + wd;
    if (window.screen) 
    { 
        var avht = screen.availHeight; 
        var avwd = screen.availWidth;
        var xcen = (avwd - wd) / 2; 
        var ycen = (avht - ht) / 2;
        args += ",left=" + xcen + ",screenX=" + xcen;
        args += ",top=" + ycen + ",screenY=" + ycen + ",resizable=yes"; 	
    }
    return window.open(img, '', args); 
} 


	//Finished Pop-up window functions -->