function openpic(url, w, h)
{
        var doscrolls = "no";
        var xw = w;
        var xh = h;
        if (h >= screen.height + 10) { doscrolls = "yes";xh = screen.height - 15; }
        if (w >= screen.width + 10) { doscrolls = "yes";xw = screen.width - 10; }
        var left   = (screen.width  - w)/2;
        var top    = (screen.height - h)/2;

	// add room for picture description text if we're viewing a file in photos -folder
	if (url.match("photos/")!=null) { xh = xh + 50; }

        window.open("pic.php?photo="+url+"&width="+w+"&height="+h, "BlakePic", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+doscrolls+",width="+xw+",height="+xh+",top="+top+",left="+left);
}
