var popWin = null;
var popHtml = "popImg.html"; 	// relToBase added below, so path relative to file including this one

function PopImg(relToBase, fPath, height, width) {
	if (popWin && !popWin.closed) {
		if (popWin.document.form1.elements["popImgPath"].value.indexOf(fPath) > -1) {
			popWin.focus();
		} else {
			popWin.close();
			popWin = null;
		}
	} else {
		document.form1.elements["popImgPath"].value = fPath;
		var leftSide = Math.round((window.screen.width-width)/2);
		popWin = window.open((relToBase + popHtml), "popWin",
					"scrollbars=no,status=no,toolbar=no,location=no,directories=no,menubar=no,resizable=no,copyhistory=no,width=" 
					+ width + ",height=" + height + ",left=" + leftSide + ",top=5");
	}
}

