var win;
var lastsrc;
var boxwidth;
var boxheight;
var attributes;
var showpic;
var text;
var caption;
function closepicwin(){if (win && !win.closed) {win.close();}}

function picwin(inpic,w,h,intext,incaption){
	if (navigator.appName.indexOf("Netscape") != -1){
	boxwidth = 450;
	boxheight = 575
	} else {
		if ((w+50) != boxwidth || (h+130) != boxheight) {
			closepicwin();
			if (w < 350) {
				boxwidth = 350;
			} else {
				boxwidth = w+50;	
			}
			boxheight = h+135;
		}
	}
	showpic = inpic;
	text = intext;
	caption = incaption;
	if (text == null) {
		text = '\&nbsp\;';
	}
	attributes = 'width=' + boxwidth + ',height=' + boxheight + ',scrollbars';
	//if (showpic != lastsrc || showpic == 'images/spg.gif') {
	if (!win || win.closed) {win = window.open("photopopup.htm","",attributes); lastsrc = ""; if (!win.opener){win.opener = window;}} else {win.focus();}
	//}
	lastsrc = showpic;}